标签:
/*** -XX:+PrintGC -Xloggc:gc.log** VM args: -Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError*/public class HeapOOM {static class OOMObject {}public static void main(String[] args) throws InterruptedException {List<OOMObject> list = new ArrayList<>();while(true){list.add(new OOMObject());// System.out.println("sleep");// Thread.sleep(1000l);}}

左方为控制台输出,右方为heap dump分析中线程信息。





标签:
原文地址:http://www.cnblogs.com/eblly/p/5550667.html