Bye PermGen
The latest JKD 8 builds no longer have PermGen. I remember back in I believe 2010 at either an EclipseCon or Devoxx where Oracle was talking about their future VM strategy. The future VM was to be HotSpot with parts from [JRockit] (http://www.oracle.com/technetwork/middleware/jrockit/overview/index.html) ported over. Jokingly this VM war referred to as HotRockit or JSpot. One of the parts to be ported was the removal of PermGen. It’s nice to see tech companies deliver on their promises.
Does this Mean an End to java.lang.OutOfMemoryError: PermGen space?
Yes. Now class metadata and interned strings are in native memory. In fact if you start the latest HotSpot with -XX:MaxPermSize=256m
you will get the following error message:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Does this Mean an End to ClassLoader Leaks?
No. There still are circular references between Class and ClassLoader. There is a good reason for this in the java language specification section 12.7. Unloading of Classes and Interfaces. So leaks will stay, you’ll just leak native memory instead of PermGen.
The move doesn’t seem complete at this point as VisualVM still reports a non-empty PermGen.
Update: It seems that what VisualVM reports as PermGen is actually the new MetaSpace.