Late cleanup of stack objects

Alan Bateman Alan.Bateman at oracle.com
Mon Nov 7 11:54:50 UTC 2022


On 07/11/2022 07:29, Sam Pullara wrote:
> I am kind of annoyed this doesn't solve the problem (scoping the 
> allocation):

You may have reduced the scope of bigBuffer in the source code but the 
code generated by the javac compiler will be the same, meaning the 
method will have the same number of locals as before.

For Arnaud's test, the local for bigBuffer will be live when it is 
running in the interpreter so freezing the stack during slowIO will keep 
it reachable.  It should be different once the code is warmed and 
compiled by C2 but it may be that the observations with VisualVM are 
done before it is compiled at run-time.

-Alan


More information about the loom-dev mailing list