Out of memory errors in java can some time mean a memory leak in application. One class of those memory errors are related to memory pressure in permgen. This is typically identified by exception message like Root Cause Exception: java.lang.OutOfMemoryError: PermGen space
As memory management is done by jvm, identifying and debugging memory leaks in java can be tricky. In case of permgen leaks, more so. Reasons for this include:
- Permgen leaks are rare
- More often than not; out of memory errors due to permgen space is not a leak but a legitimate case of memory crunch. In which case you either need to allocate more memory to permgen using
-XX:MaxPermSize
jvm parameter or strip down your libraries and dependencies.