Re: ClassValue rooting objects after it goes away?

2018-03-02 Thread Charles Oliver Nutter
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,

Re: ClassValue rooting objects after it goes away?

2018-03-02 Thread Charles Oliver Nutter
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

Re: ClassValue rooting objects after it goes away?

2018-03-02 Thread Charles Oliver Nutter
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

Re: ClassValue rooting objects after it goes away?

2018-03-02 Thread Vladimir Ivanov
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).