
一、产生背景
二、概述
三、特点
四、栈中存什么
五、栈帧中存什么
六、栈的运行原理
七、栈中常见的异常 & 如何设置栈大小
7.1、概述
7.2、默认情况下栈的大小
/**
* @Author : 一叶浮萍归大海
* @Date: 2023/11/16 18:55
* @Description: 默认情况下栈的大小
*/
public class StackMainApp {
private int stackLength = 1;
public void stackLeak() {
stackLength++;
stackLeak();
}
public static void main(String[] args) {
StackMainApp stackMainApp = new StackMainApp();
try {
stackMainApp.stackLeak();
} catch (Throwable e) {
System.out.println("stackLength = " + stackMainApp.stackLength);
e.printStackTrace();
}
}
}
7.3、修改栈的大小
-Xss128k