java.lang.Thread.contextClassLoader : what if it were a weak reference ? (original) (raw)
Sylvain Laurent sylvain.laurent at m4x.org
Sun Mar 22 22:23:32 UTC 2009
- Previous message: Setup OpenJDK Netbeans project - Please help!
- Next message: java.lang.Thread.contextClassLoader : what if it were a weak reference ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello all,
I'm tracking classloader leaks more or less as a hobby and found out
that one of the (many) source of leaks come from threads that still
have a reference to a classloader through their contextClassLoader
instance variable.
So, I'm wondering : what if instead of "private ClassLoader
contextClassLoader;" we had "private WeakReference
contextClassLoaderRef" and the method getContextClassLoader would more
or less returned contextClassLoaderRef.get() ?
Would it break many things ? is it incompatible with the specs ?
I'm very interested to read your opinion on this...
Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20090322/8d8cbe81/attachment.html>
- Previous message: Setup OpenJDK Netbeans project - Please help!
- Next message: java.lang.Thread.contextClassLoader : what if it were a weak reference ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]