The following exceptional conditions are associated with Java Virtual Machine stacks:
If the computation in a thread requires a larger Java Virtual Machine stack than is permitted,the Java Virtual Machine throws a StackOverflowError.
If Java Virtual Machine stacks can be dynamically expanded,and expansion is attempted but insufficient memory can be made available to effect the expansion,or if insufficient memory can be made available to create the initial Java Virtual Machine stack for a new thread,the Java Virtual Machine throws an OutOfMemoryError.
对于本地方法栈
The following exceptional conditions are associated with native method stacks:
If the computation in a thread requires a larger native method stack than is permitted,the Java Virtual Machine throws a StackOverflowError.
If native method stacks can be dynamically expanded and native method stack expansion is attempted but insufficient memory can be made available,or if insufficient memory can be made available to create the initial native method stack for a new thread,the Java Virtual Machine throws an OutOfMemoryError.