Skip to content

Instantly share code, notes, and snippets.

View josetesan's full-sized avatar

Jose Luis Sánchez josetesan

View GitHub Profile
@josetesan
josetesan / permgen.md
Created November 14, 2017 10:16 — forked from JDatta/permgen.md
JAVA: Debugging a permgen leak

JAVA: Debugging a permgen leak

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.