Relates :
|
|
Relates :
|
|
Relates :
|
To dispose of Java2D-related resources we (Java2D) create a Java2D-Disposer thread the first time any Java2D-related activity is encountered (it is started from static block of Disposer class). This thread then lives forever. There is a couple of problems: first, if the customer's thread has an InheritableThreadLocal, our thread inherits it and thus it never gets disposed of even if customer's thread went away. This is not specific to our Disposer thread - if, say, an EventDispatchThread is started from the customer's thread it could also run into this issue. Another issue is that the Disposer thread inherits the parent thread's contextClassLoader, and since our thread lives forever, any classes referenced by that loader are not being collected (and since those could be customer's classes, they could contain some large data, leading to huge memory leaks). Here's a thread which started the discussion: http://forums.java.net/jive/thread.jspa?messageID=169608𩚈
|