Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353095

Summary: maven-jetty-plugin: PermGen leak due to javax.el.BeanELResolver
Product: [RT] Jetty Reporter: Robert Munteanu <robert.munteanu>
Component: serverAssignee: Jan Bartel <janb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: janb, jetty-inbox
Version: 7.4.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Screenshot of a HProf dump analysed with YourKit Java Profiler
none
sample project
none
sample project with servlet-api and jsp-api marked as provided none

Description Robert Munteanu CLA 2011-07-26 07:21:50 EDT
When using the maven-jetty-plugin and the standard forEach tag, PermGen is leaked on each redeploy due to the jaxax.el.BeanResolver holding strong references to classes loaded from the webapp. On each redeploy of the application the previous classloader remains in memory.
Comment 1 Robert Munteanu CLA 2011-07-26 07:23:58 EDT
Created attachment 200348 [details]
Screenshot of a HProf dump analysed with YourKit Java Profiler

I can make the hprof dump available if needed.
Comment 2 Robert Munteanu CLA 2011-07-26 07:28:58 EDT
Created attachment 200349 [details]
sample project

To reproduce the problem, simply execute mvn jetty:run in the sample project. Load the first page then reload the application 3-4 times. Take a HProf snapshot and the classloader leak will be visible.
Comment 3 Robert Munteanu CLA 2011-07-26 07:44:57 EDT
Created attachment 200350 [details]
sample project with servlet-api and jsp-api marked as provided

Does not make a difference when redeploying, but should be correct.
Comment 4 Jan Bartel CLA 2011-07-27 06:07:46 EDT
Wonderful. Looks like the javax.el api is not well designed:

http://java.net/jira/browse/GLASSFISH-1649

Will implement a clean-up operation on webapp undeploy.
Comment 5 Jan Bartel CLA 2011-07-28 21:11:59 EDT
Also discovered that java.beans.Introspector has a static cache of bean Methods that will cause the WebAppClassLoader to be retained, so fixed that as well.
Comment 6 Robert Munteanu CLA 2011-07-29 02:56:04 EDT
Great!

Is there a nightly I can test?
Comment 7 Robert Munteanu CLA 2011-07-29 04:30:02 EDT
Nevermind, I was able to build it myself and override the dependencies of the plugin.

Thanks once again.