I had some similar concerns with some data structures I maintain in Dynalink; I
specifically have a utility method to check if classes from two class loaders
are allowed to keep strong references to each other
(jdk.dynalink.internal.InternalTypeUtilities.canReferenceDirectly if you want
to
Hi Charles,
On 03/02/2018 09:22 PM, Charles Oliver Nutter wrote:
Put it another way: does a static reference from a class to itself
prevent that class from being garbage collected? Of course not.
ClassValue is intended to be a way to inject pseudo-static data into
either a class or a Class.
Put it another way: does a static reference from a class to itself prevent
that class from being garbage collected? Of course not. ClassValue is
intended to be a way to inject pseudo-static data into either a class or a
Class. Injecting that data, even if it has a reference back to the class,
I have posted a modified version of my description to the main bug report.
TLDR: ClassValue should not root objects.
- Charlie
On Fri, Mar 2, 2018 at 2:13 PM Charles Oliver Nutter
wrote:
> Yes, it may be the same bug.
>
> In my case, the ClassValue is held by a utility
Yes, it may be the same bug.
In my case, the ClassValue is held by a utility object used for our Java
integration. That utility object has to live somewhere, so it's held by the
JRuby runtime instance. There's a strong reference chain leading to the
ClassValue.
The value is a Ruby representation
Charlie,
Does it look similar to the following bugs?
https://bugs.openjdk.java.net/browse/JDK-8136353
https://bugs.openjdk.java.net/browse/JDK-8169425
If that's the same (and it seems so to me [1]), then speak up and
persuade Paul it's an important edge case (as stated in JDK-8169425).
So I don't think we ever closed the loop here. Did anyone on the JDK side
confirm this, file an issue, or fix it?
We still have ClassValue disabled in JRuby because of the rooting issues
described here and in https://github.com/jruby/jruby/pull/3228.
- Charlie
On Thu, Aug 27, 2015 at 7:04 AM
Hi,
In trying to reproduce the problem outside of Groovy I stumbled over a
case case which I think should work
public class MyClassValue extends ClassValue {
protected Object computeValue(Class type) {
Dummy ret = new Dummy();
Dummy.l.add (this);
return ret;
}
One more thing...
Remi, I tried your link with my simplified scenario and it does there
not stop the collection of the classloader
Am 27.08.2015 11:54, schrieb Jochen Theodorou:
Hi,
In trying to reproduce the problem outside of Groovy I stumbled over a
case case which I think should work
Am 27.08.2015 00:54, schrieb Remi Forax:
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
original -
De: Jochen Theodorou blackd...@gmx.org
À: Da Vinci Machine Project mlvm-dev@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
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
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.
No,
it's not expected !
Rémi
Le 6 août 2015 20:26:43 CEST, Charles Oliver Nutter head...@headius.com a
écrit :
Pardon me if this has been discussed before, but we had a bug (with
fix) reported today that seems to indicate that the JVM is rooting
objects put into a ClassValue even if the
14 matches
Mail list logo