ClassValue rooting objects after it goes away?
Remi Forax
forax at univ-mlv.fr
Wed Aug 26 22:54:10 UTC 2015
Hi Jochen,
what you can try is to use this code written by Jerome Pilliet as replacement of ClassValue (using -Xbootclasspath/p)
https://bitbucket.org/jpilliet/libcore-292/src/tip/libdvm/src/main/java/java/lang/ClassValue.java?at=4.4.3.292
to see if you can reproduce your bug or not with this other implementation of ClassValue (under Apache Licence).
Note that i hope that this implementation works but it's clearly haven't been battletested,
nevertheless if you can not reproduce your issue, it means that this is clearly a bug in the OpenJDK implementation.
regards,
Rémi
----- Mail original -----
De: "Jochen Theodorou" <blackdrag at gmx.org>
À: "Da Vinci Machine Project" <mlvm-dev at openjdk.java.net>
Envoyé: Mercredi 26 Août 2015 22:40:53
Objet: Re: ClassValue rooting objects after it goes away?
Am 07.08.2015 13:04, schrieb Michael Haupt:
> Hi Charles,
>
> the pull request mentions a class named Java7ClassValue - does this mean
> it's a Java 7 issue or is it reproducible on 8 and maybe even 9? Names
> can be misleading. ;-)
>
> To clarify: by what means is the ClassValue removed in the JRuby
> implementation?
>
> I agree this should not happen.
coming back on this and after spending the whole day on debugging a
permgen issue (and Cedric actually 3 days) that seems to be related to this.
I am not from the Ruby guess, so I will show the Groovy part. We
discovered a permgen issue, that prevents the groovy runtime from
unloading and the reason turned out to be ClassValue. We get a similar
graphic Charles got, only a bit more complex. In my test scenario we
load the Groovy runtime in an URLClassLoader, call a method to cause the
runtime to initialize and then forget about it, just to do this again in
a loop. What happens is that we get into a permgen problem, since the
loader cannot be unloaded because ClassValue seems to keep classes from
that loader to unload.
I tested this with 7_60, 7_65, 8_25, and jdk1.9.0-ea-b68. All have this
problem.
As a special bonus we have a lot of system classes with added class
values... for example all the primitive types. I suspected ClassValue
earlier already and made myself a simple test but it seems the simple
version is not going to show me what I want. So it is not as simple as
having a classloader load a custom ClassValue class and have the
classloader not unloading.
Guess we will try the WeakReference vesion next as well... not that is a
solution for us.
bye blackdrag
--
Jochen "blackdrag" Theodorou
blog: http://blackdragsview.blogspot.com/
_______________________________________________
mlvm-dev mailing list
mlvm-dev at openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
More information about the mlvm-dev
mailing list