RE: Protecting references from GC in JDI tests

2020-08-24 Thread Aditya Mandaleeka
Thanks for the replies Dan and Roger. > My recommendation would be to only use > ObjectReference.DisableCollection() > when you have observed a specific failure for a specific object in a > test. OK. I will submit an RFR soon to guard the specific case that we've observed consistently failing

Re: Protecting references from GC in JDI tests

2020-08-18 Thread Roger Riggs
Hi, You may also find useful java.lang.ref.Reference.reachabilityFence(obj [1] . It is designed to prevent the compiler from optimizing away a reference. It keeps the object referenced up to that point. [1] https://download.java.net/java/GA/jdk14/docs/api/java.base/java/lang/ref/Reference.html#

Re: Protecting references from GC in JDI tests

2020-08-17 Thread Daniel D. Daugherty
Aditya, I think you've found the right alias... A similar observation was made here: http://mail.openjdk.java.net/pipermail/serviceability-dev/2020-March/030635.html It looks like that conversation didn't go beyond Egor's original message and Chris P's reply. My recommendation would be to onl

Protecting references from GC in JDI tests

2020-08-17 Thread Aditya Mandaleeka
Hi serviceability-dev, I hope this is the right list for this topic, but feel free to redirect if not... It appears that there are jtreg tests that exercise JDI functionality without protecting target objects from being GC'd. An example of this is com/sun/jdi/VarargsTest.java, where references