My jetty server
(9.1.4.v20140401) eventually runs out of memory after I’ve
deployed the same war (during development) to the webapps
folder. After looking in the bugs database I think this might be
happening because I’m deploying jars inside the war’s lib
folder.
The reason I think this
is that looking at the heap dump (in MAT) I can see 8 copies of
classes from those bundled jars. Each of the instances was
loaded by a different instance of
org.eclipse.jetty.webapp.WebAppClassLoader.
My theory is that when
the war is redeployed a new instance of WebAppClassLoader is
created which then loads the new jar files.
I think I’m doing
something wrong, but haven’t been able to figure out what. I’m
not sure how to get the old class loader’s to go away.
I’ve tried using the
leak preventer (http://www.eclipse.org/jetty/documentation/current/preventing-memory-leaks.html)
by putting this into my jetty.xml file:
<Call name="addBean">
<Arg>
<New class="org.eclipse.jetty.util.preventers.AppContextLeakPreventer"/>
</Arg>
</Call>
But it didn’t seem to
make a difference.
Any ideas or pointers to
appropriate documentation?
Thanks,
-Andrew