/** * VM Args:-Xss128k * */ public class JavaVMStackSOF { private int stackLength = 1; public void stackLeak() { stackLength++; stackLeak(); } public static void main(String[] args) throws Throwable { JavaVMStackSOF oom = new JavaVMStackSOF(); try { oom.stackLeak(); } catch (Throwable e) { System.out.println("stack length:" + oom.stackLength); throw e; } } }
版权声明:本文为博主原创文章,未经博主允许不得转载。
读书笔记-深入理解JVM虚拟机-1.JVM-Stack造成的OOM的理解
原文地址:http://blog.csdn.net/u010708203/article/details/46873973