I know that this problem has been around for at least 3 yeears (Issue 92), but I'm still not satisfied with the current state of it. I am also aware that this does not affect Tomcat if you do restart after redeploying (as suggested in Guice + Tomcat potential memory leak).
My problem is that I am experiencing OutOfMemoryError: PermGen
errors after some redeployments. Notice that I am not using google-collections explicitly, I am only using Guice 3.0 (via maven). After analyzing heap dumps, I still see that the thread com.google.inject.internal.Finalizer
is still active, keeps a reference to Tomcat's WebappClassLoader, thus hindering garbage collection.
What if I actually require redeployments without restarting and am using Guice? What are my options?