[richfaces-issues] [JBoss JIRA] Created: (RF-8216) ThreadLocal/Memory leak in ColumnsHandler

Thomas W (JIRA) jira-events at lists.jboss.org
Wed Dec 16 15:08:30 EST 2009


ThreadLocal/Memory leak in ColumnsHandler
-----------------------------------------

                 Key: RF-8216
                 URL: https://jira.jboss.org/jira/browse/RF-8216
             Project: RichFaces
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: core
    Affects Versions: 3.3.1
            Reporter: Thomas W


I have found this issue when hunting down memory leaks on hot deployment with tomcat. It prevents the classloader from unload and leaks memory even outside of hot deployment in HTTP worker threads. This is just one example. Looking at how plain and obvious it is, there are probably more issues hiding in other components. There should be test with ideally full code coverage, followed by inspection of  the JVM heap for leaks.

There is a nice post here on how to perform the latter: http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded

The specific culprit I found is the columns tag (ColumnsHandler).

I had to add the following in a subclass to prevent the leak:

	@Override
	public void apply(FaceletContext ctx, UIComponent parent)
			throws IOException, FacesException, ELException {
		super.apply(ctx, parent);
		// fix memory/classloader leak
		super.iterationContextLocal.remove();
	}
 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list