I was checking one of my web applications to see if I there was anything
wrong with the framework we use, as I had fixed a small issue that could
help with memory usage and I have found out some "symptoms" that I think
might be related to Resin and/or the libraries, so I wanted to check
with you guys if know what could be the issue here.
I'm using Resin 3.1.1 under Java 6 and the profiler is YourKit Java
.- I start the application, access one page to verify it is fully loaded
and then take a snapshot.
.- I modify web.xml so the context is restarted, access the same page
again, try to force garbage collection and wait until memory usage is
stable, then take a second snapshot.
.- Repeat the same step.
After that, comparing the snapshots and looking at the new objects
created, I get that each time the context is restarted, the new object
that "consumes" more memory is com.caucho.loader.EnvironmentClassLoader.
In fact, upon the initial load I have 5 instances of that class, after
the first restart I have 6, after the second restart I have 7 instances...
The extra instances seem to be related to HSQLDB, Quartz, Apache log and
some java.security classes, but I'm not sure yet who is guilty of
keeping the whole set alive, or if that's normal.
Something similar happens with com.caucho.xml.Xml: I start with 2
instances, one referenced from a class of mine and another from
java.lang.ThreadLocal. After a restart I get 2 instances referenced from
java.lang.ThreadLocal. Another restart and I have 3 referenced from
java.lang.ThreadLocal... In this case, the problem seems to be a growing
number of instances from org.apache.xml.utils.XMLReaderManager... that
are themselves related to the aforementioned
So my question would be if anybody has run into similar issues or has
any idea what could be causing the proliferation of
com.caucho.loader.EnvironmentClassLoader instances. I suspect it might
be that some library is keeping a reference to the classloader through
some daemon thread that is not being properly initialised when the
context is restarted.
Any hints on how to further debug this issue? Any similar experience?
resin-interest mailing list