Stack walking performance issue

Amir Hadadi amirhadadi at
Mon Mar 18 21:32:35 UTC 2019

If anyone is willing to build an Open JDK with this fix I can give it a spin.
From: Andrew Haley <aph at>
Sent: Monday, March 18, 2019 5:30 PM
To: Stefan Karlsson; Amir Hadadi; zgc-dev at
Subject: Re: Stack walking performance issue

On 3/18/19 1:59 PM, Stefan Karlsson wrote:
> On 2019-03-18 14:48, Andrew Haley wrote:
>> On 3/18/19 11:33 AM, Stefan Karlsson wrote:
>>> In ZGC (in JDK 11), we actually do clean out the "weak" pointers in the
>>> ResolvedMethodTable, but we do not remove the entries. Therefore, if you
>>> do a lot of stack walking and throw away the StackFrameInfos, the
>>> ResolvedMethodTable will fill up with cleared entries pointing to NULL.
>> That's got to be easily fixable, surely?
> Yes. It should be enough to call ResolvedMethodTable::unlink() in the
> mark end phase. However, that has the potential to increase the time of
> that pause. So for JDK 12, we've opted to send a signal to the
> ServiceThread, and let that thread execute the unlinking concurrently
> with the Java threads.

For JDK 11, I guess the severe slowdown is more severe than the extended
pause time. I invite someone (anyone?) to try doing what you suggest.
Amir, can you build and test it?

Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the zgc-dev mailing list