VM deadlock between VM shutdown and G1

Krystal Mok rednaxelafx at gmail.com
Thu Sep 13 14:06:31 UTC 2018


On Thu, Sep 13, 2018 at 5:00 AM, David Holmes <david.holmes at oracle.com>
wrote:

> Hi Kris,
>
> Okay got it now.
>
> So basically:
>
> Universe::heap()->stop();
>
> has to be written in such a way that it can safely be called even if
> there's a GC related VMop in execution.
>
> Cheers,
> David


Yes exactly. It's a deadlock and you need two hands to make a clap, so
either Universe::heap()->stop() needs to do more signaling (perhaps setting
a global flag to indicate the concurrent GC threads are gone, and let the
GCs pick it up), or the concurrent GCs themselves have to be more careful
to check for VM exiting conditions when in a wait loop.

- Kris


More information about the hotspot-dev mailing list