Stack sizes and stack allocation

Vitaly Davidovich vitalyd at gmail.com
Wed Aug 12 12:23:05 UTC 2015


It will throw stackoverflow error.  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.

sent from my phone
On Aug 12, 2015 7:15 AM, "Kees Jan Koster" <kjkoster at gmail.com> wrote:

> Dear Jenny,
>
> >> Conversely, if stack allocation calls for too many objects to be
> allocated on the stack, does the JVM throw a stack overflow error, or fall
> back to heap allocation?
> > No. When escape analysis is enabled, some heap objects might be put on
> stack though.
>
> Just so I understand correctly: imagine escape analysis is enabled. For a
> certain bit of code, the escape analysis logic decides that a certain heap
> object can be allocated on the stack.
>
> If the stack size is too small for that object, does the JVM throw a stack
> overflow error, or does the JVM allocate the object on the heap instead?
>
> --
> Kees Jan
>
> http://java-monitor.com/
> kjkoster at kjkoster.org
> +31651838192
>
> I hate unit tests; I much prefer the illusion that there are no errors in
> my code.
>                                                                 -- Hendrik
> Muller
>
>
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20150812/b33dd070/attachment.html>


More information about the hotspot-gc-use mailing list