RFR 8220238 : Enhancing j.l.Runtime/System::gc specification with an explicit 'no guarantee' statement

Martin Buchholz martinrb at google.com
Thu May 30 17:30:47 UTC 2019

If you are calling System.gc() for correctness (e.g. in a test), it is
probably because some sort of finalization is being triggered.  And that
happens in some Java thread (e.g. Reference Handler) that System.gc() has
no control over.  So in practice, users need to call System.gc() and then
wait for subsequent reference processing somehow.

More information about the core-libs-dev mailing list