OutOfMemoryError: PermGen caused by IvyContext leaked when building subprojects
-------------------------------------------------------------------------------
Key: IVY-1332
URL: https://issues.apache.org/jira/browse/IVY-1332
Project: Ivy
Issue Type: Bug
Components: Core
Reporter: Ales Nosek
The build.xml files of my subprojects include Ant's <taskdef/> element to
define Ivy tasks. This element causes creation of a new classloader to load the
Ivy jars.
The code from IvyContext.java:
public class IvyContext {
private static ThreadLocal/*<Stack<IvyContext>>*/ current = new
ThreadLocal();
...
}
This static initialization runs once with every classloader and creates a new
ThreadLocal object every time. All those ThreadLocal objects are visible
(referenced) from the main Thread. For 12 subprojects I end up with 12
ThreadLocal objects each containing one Stack holding IvyContext objects. The
IvyContext objects point to its class which points to its ClassLoader. The 12
ClassLoaders stay retained.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira