Stack sizes and stack allocation

Kees Jan Koster kjkoster at gmail.com
Thu Aug 13 16:23:29 UTC 2015


Dear Vitaly,

> It will throw stackoverflow error.

Right, that’s good. So by reducing the stack size we are not inadvertently reducing the ability for the VM to optimise.

> Keep in mind that escape analysis (currently) only does scalar replacement and not true stack allocation, so the stack usage of it is additional registers and spill slots, no different than calling a method with more arguments.

What does ‘scalar’ mean in this context? Only atomic types? Only JVM wrapper types such as java.lang.Integer? java.lang.Strings?

How about my own types? If they have one field? Many fields?

I guess my question is: what makes a class eligible to have its instances stack-allocated by escape analysis?

--
Kees Jan

http://java-monitor.com/
kjkoster at kjkoster.org
+31651838192

Human beings make life so interesting. Do you know that in a universe so full of wonders,
they have managed to invent boredom. Quite astonishing... -- Terry Pratchett

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20150813/cf75f45d/signature.asc>


More information about the hotspot-gc-use mailing list