Thursday 28 January 2021

Java9: Reserved stack areas for critical sections

StackOverflowError Thrown when a stack overflow occurs because an application recurses too deeply. As part of this feature, Java reserves extra space on thread stacks for use by critical sections, so that they can complete even when stack overflows occur.

 

Problem

If a StackOverflowError Occurs in Critical section then the lock status will be in inconsistent state, which may lead to deadlock and inconsistent behaviour.

 

Solution

Reserve some more space on the execution stack for critical sections and allow them to complete their execution where regular code would have been interrupted by a stack overflow.

 

Reference

https://openjdk.java.net/jeps/270

https://self-learning-java-tutorial.blogspot.com/2014/02/how-to-increase-stack-size-in-java.html

Previous                                                    Next                                                    Home

No comments:

Post a Comment