Java????????????????
???????????? ???????[ 2015/1/19 11:11:58 ] ????????Java ???????
????????(StackOverflowError)
???????????java.lang.StackOverflowError??????????????????????????е??????????????????????????????????
????????????????????????????????????μ??????д?????????飬?п?????????????? ?????????????δ??????????′????????????????
????import java.util.*;
????import java.lang.*;
????public class OOMTest{
????public void stackOverFlowMethod(){
????stackOverFlowMethod();
????}
????public static void main(String... args){
????OOMTest oom = new OOMTest();
????oom.stackOverFlowMethod();
????}
????}
????????????????????????μ?????
????Exception in thread "main" java.lang.StackOverflowError
????at OOMTest.stackOverFlowMethod(OOMTest.java:6)
?????????(OutOfMemoryError:java heap space)
???????????????????????????java.lang.OutOfMemoryError:java heap space????????????????????????????????????????????dump?????????????????????-XX:+HeapDumpOnOutOfMemoryErrorjvm???????????????????????????п????????й?????п??????????????
??????????й???????????й?????????????GC ROOT???????????????????????????????й??????
??????????????????????????????????????????????????????????????????棬????????£??????????????-Xmx?????????????
??????????????????μ???????????′?????????????
????import java.util.*;
????import java.lang.*;
????public class OOMTest{
????public static void main(String... args){
????List<byte[]> buffer = new ArrayList<byte[]>();
????buffer.add(new byte[10*1024*1024]);
????}
????}
??????????????μ?????????????????
????java -verbose:gc -Xmn10M -Xms20M -Xmx20M -XX:+PrintGC OOMTest
???????????????μ??????
????[GC 1180K->366K(19456K)?? 0.0037311 secs]
????[Full GC 366K->330K(19456K)?? 0.0098740 secs]
????[Full GC 330K->292K(19456K)?? 0.0090244 secs]
????Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
????at OOMTest.main(OOMTest.java:7)
?????????н???????????JVM?????????Minor gc?????ε?Major gc????Major gc??????????????gc???old????????134K????????????10M??????????????old generation????????????????????????-Xms21M??-Xmx21M???????????gc?????????????????
?????????????????????????????????????????????????????????????????????????????????????????滹????????μ????????????????????????????????????????????
???????????(OutOfMemoryError: PermGen space)
???????????Hotspot jvm????????????Java??????淶?е???????????????????????????????????е????????????п???????????????????????п???????????б????class??????б????????????class?????????泬???????????á??????????????????java.lang.OutOfMemoryError: PermGen space??
????????????????????????????3????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11