Reserved stack areas for critical sections [JEP 270]
The goal of JEP 270 was to mitigate problems stemming from stack overflows during the execution of critical sections. This mitigation took the form of reserving additional thread stack space.
The pre-Java 9 situation
The JVM throws a StackOverflowError
when it is asked to perform data computation in a thread that has insufficient stack space and does not have permission to allocate additional space. This is an asynchronous exception. The JVM can also throw the StackOverflowError
exception synchronously when a method is invoked.
When a method is invoked, an internal process is used to report the Stack Overflow. While the current schema works sufficiently for reporting the error, there is no room for the calling application to easily recover from the error. This can result in being more than a nuisance for developers and users. If the StackOverflowError
was thrown during a critical computational operation, the data might be corrupted, causing...