Stack walking performance issue

Andrew Haley aph at
Mon Mar 18 15:30:20 UTC 2019

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