Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In current generation JVMs, permgen is indeed collected like other parts of the heap. The <a href="http://www.oracle.com/technetwork/java/visualgc-136680.html" rel="nofollow noreferrer">visualgc</a> page states that it is collected together with the old generation.</p> <p>In older JVMs this was apparently not always so. For instance, in Java 5 the CMS collector <em>apparently</em> did not collect permGen by default: you could enable it with <code>-XX:+CMSPermGenSweepingEnabled</code>. I also recall hearing that some really old JVMs did not implement permgen collection at all, though I cannot find a reliable source for this ... ermm ... "factoid".</p> <p>The other point, is that a lot of people have <em>incorrectly</em> attributed "OutOfMemoryError : permgen" exceptions to permgen not being collected at all. The reality is different. The most common cause of these OOME's is an insidious kind of storage leak that manifests when you hot-load code into an executing JVM. The leak occurs because when an instance of some old class that has been replaced remains reachable. This causes the object's class to be reachable, which causes the classes classloader to be reachable, which causes <em>all</em> of the old classes to be reachable, together with their code objects, their string literals, and their static frames and static. A lot of these leaked objects live in permgen space.</p> <hr> <p><strong>UPDATE</strong></p> <p>As of Java 8, permgen no longer exists: <a href="https://stackoverflow.com/questions/18339707/permgen-elimination-in-jdk-8">PermGen elimination in JDK 8</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload