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

Aleksey Shipilev shade at redhat.com
Thu May 30 16:54:32 UTC 2019


On 5/30/19 6:48 PM, Roger Riggs wrote:
> There are several ways to monitor the progress/"completion" of gc,
> including visible affects on WeakReference, etc., Runtime.availableMemory, etc.
> Without the ("or ever"), the case can be made that eventually some kind of completion
> should be/must be visible directly or indirectly.

Yes. I had implemented that code several times before, and it sucked every time. That was before I
discovered System.gc() is actually blocking by the virtue of "When control from the method call,
...". If we are relaxing that, can we at least provide the implementation note that some
implementations choose to block, for users' convenience?

-Aleksey



More information about the core-libs-dev mailing list