????4???????????????????????????????д?????????????????????в?????????????????????????????GC????????????????????????????????????
????????
public class Test {
public static void main(String[]args)
{
List<People> list = new ArrayList<People>();
while(true)
{
list.add(new People());
}
}
public static class People {
public String name = "zeng";
public int age = 24;
}
}
?????????
????java.lang.OutOfMemoryError: Java heap space
????Dumping heap to java_pid16912.hprof ...
????Heap dump file created [76764870 bytes in 0.978 secs]
????Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
????at Test.main(Test.java:12)
????????????????????????????????????java??治????????????????????????С????????磺Xms500m??Xmx1000m????????????????檔
?????????????????ū???????????????????????????????????????????????gc????????
????5??????????????????????????????????????????????????????????????????й???
????6???????檔?????????????????????????????????????????????????????????????????????????磺-XX:MaxDirectMemorySize=1000m
?????????????????????????????????й???????????????????????????????????????????
????OutOfMemory - java heap space:?????
????OutOfMemory -PerGem space:?????????????
????StackOverFlowError.: ????
????????????????????????????????????????С???????????????棬???????ж??