栈溢出:
1 public void f() { 2 f(); 3 }
堆内存溢出:
1 public void testd() { 2 List<String> list = new ArrayList<>(); 3 int i = 0; 4 while(true) { 5 list.add(new String(i+"")); 6 i++; 7 } 8 }
栈溢出:
1 public void f() { 2 f(); 3 }
堆内存溢出:
1 public void testd() { 2 List<String> list = new ArrayList<>(); 3 int i = 0; 4 while(true) { 5 list.add(new String(i+"")); 6 i++; 7 } 8 }