4 ms·
> When i create a new thread, i expect its stack to be allocated before the break Why? Stacks are just memory like any other. You can put them wherever you wan
by chrisseaton 5y ago
> When i create a new thread, i expect its stack to be allocated before the break
Why? Stacks are just memory like any other. You can put them wherever you want.
> so the jvm could have to request to move the break and grow the heap
The JVM allocates heap space using mmap, not by moving the break.
> you can receive a further OOME while handling an exception and that’s just bad luck
If you're being reasonable you don't - the JVM maintains emergency heap storage (pre-committed!) space so it can keep allocating even when out-of-memory.