After stopping my web app, a significant amount of PermGen is not being released. The culprit seems to be the WebappClassLoader (in Tomcat, but it happens in Jetty too), which is kept in memory by references from a bunch of other objects. The following image shows that objects that refer to WebappClassLoader, and the things that refer to them, and so on.
One of the clingy objects seems to be an instance of net.lag.logging.Level$INFO$
, to which a reference is stored in the static known
array in java.util.logging.Level
.
It appears that java.util.logging.Level
keeps a static reference to all instances of itself. Bad, nasty java.util.logging.Level
! Can I do anything about it? The java.util.logging framework is used by a third-party library, so I don't think I have the option of not using it.