Version of google-http-java-client (e.g. 1.5.0-beta)?
1.13.1-beta
Java environment (e.g. Java 6, Android 2.3, App Engine)?
Any environment with custom classloaders.
Describe the problem.
com.google.api.client.util.escape.Platform uses a custom ThreadLocal class to
implement the initialValue() method. Unfortunately this can lead to a
classloader leak in servlet and OSGI environments, since the thread refers to
the ThreadLocal.ThreadLocalMap, each entry in the map refers to the
ThreadLocal, and the custom ThreadLocal refers to the ClassLoader. There is
some more about this at:
http://wiki.apache.org/tomcat/MemoryLeakProtection#customThreadLocal
How would you expect it to be fixed?
Don't extend the ThreadLocal with a custom class, and implement the initial
value support by checking for null from get(). This prevents the ClassLoader
leak, since the ThreadLocal class and the char[] array are both loaded from the
system classloader.
Original issue reported on code.google.com by ca...@carey.geek.nz on 28 Jan 2013 at 9:50
Original issue reported on code.google.com by
ca...@carey.geek.nz
on 28 Jan 2013 at 9:50