Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353095 - maven-jetty-plugin: PermGen leak due to javax.el.BeanELResolver
Summary: maven-jetty-plugin: PermGen leak due to javax.el.BeanELResolver
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.4.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-26 07:21 EDT by Robert Munteanu CLA
Modified: 2011-07-29 04:30 EDT (History)
2 users (show)

See Also:


Attachments
Screenshot of a HProf dump analysed with YourKit Java Profiler (64.02 KB, image/png)
2011-07-26 07:23 EDT, Robert Munteanu CLA
no flags Details
sample project (5.59 KB, application/octet-stream)
2011-07-26 07:28 EDT, Robert Munteanu CLA
no flags Details
sample project with servlet-api and jsp-api marked as provided (10.75 KB, application/octet-stream)
2011-07-26 07:44 EDT, Robert Munteanu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.