New in Java 9

With the JEP 270 changes for Java 9, a critical section will automatically be given additional space so that it can complete its execution and not suffer from the StackOverflowError. This is predicated on the additional space allocation needs being small. The necessary changes have been made to the JVM to permit this functionality.

The JVM actually delays the StackOverflowError, or at least attempts to, while critical sections are executing. In order to capitalize on this new schema, methods must be annotated with the following:

    jdk.internal.vm.annotation.ReservedStackAccess

When a method has this annotation and a StackOverflowError condition exists, temporary access to the reserved memory space is granted. The new process ...

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.