package com.gochinatv.cdn.api.jdk.jvm;

/**
 * 
 * @author jack
 * -Xms2m -Xmx2m -Xss160k -XX:+PrintGCDetails
 * java -X 非标准输出
 */
public class HeapOOM {
   
	public static void main(String[] args) {
		int number = 0;
		while(true){
			byte[] b = new byte[1024*1024*5];
			System.out.println(++number);
		}
	}
}

@@ -43,71 +43,571 @@
 *%0A *
- %0A * @author jack%0A * -Xms2m -Xmx2m -Xss160k -XX:+PrintGCDetails
+%0A * http://blog.csdn.net/yohoph/article/details/42041729%0A *%0A * -XX:+PrintGCDetails %E5%BC%80%E5%85%B3%EF%BC%8C%E5%8F%AF%E4%BB%A5%E8%AF%A6%E7%BB%86%E4%BA%86%E8%A7%A3GC%E4%B8%AD%E7%9A%84%E5%8F%98%E5%8C%96%0A * -XX:+PrintGCTimeStamps %E5%BC%80%E5%85%B3%EF%BC%8C%E5%8F%AF%E4%BB%A5%E4%BA%86%E8%A7%A3%E8%BF%99%E4%BA%9B%E5%9E%83%E5%9C%BE%E6%94%B6%E9%9B%86%E5%8F%91%E7%94%9F%E7%9A%84%E6%97%B6%E9%97%B4%EF%BC%8C%E8%87%AAJVM%E5%90%AF%E5%8A%A8%E4%BB%A5%E5%90%8E%E4%BB%A5%E7%A7%92%E8%AE%A1%E9%87%8F%0A * -XX:+PrintGCDateStamps GC%E5%8F%91%E7%94%9F%E7%9A%84%E6%97%B6%E9%97%B4%E4%BF%A1%E6%81%AF%0A * -XX:+PrintHeapAtGC %E5%BC%80%E5%85%B3%E4%BA%86%E8%A7%A3%E5%A0%86%E7%9A%84%E6%9B%B4%E8%AF%A6%E7%BB%86%E7%9A%84%E4%BF%A1%E6%81%AF%0A * -XX:+HeapDumpOnOutOfMemoryError %E5%A0%86%E5%86%85%E5%AD%98%E6%BA%A2%E5%87%BA%E7%9A%84%E6%97%B6%E5%80%99%E6%89%93%E5%8D%B0%E9%94%99%E8%AF%AF%E7%9A%84%E5%A0%86%E4%BF%A1%E6%81%AF%0A * -XX:HeapDumpPath %E5%A0%86%E5%86%85%E5%AD%98%E6%BA%A2%E5%87%BA%E6%89%93%E5%8D%B0%E6%97%A5%E5%BF%97%E7%9A%84%E4%BD%8D%E7%BD%AE,%E6%AF%94%E5%A6%82%E8%BE%93%E5%87%BA%E7%9A%84%E5%9C%B0%E5%9D%80%E4%B8%BA /Users/zhuhuihui %E6%96%87%E4%BB%B6%E5%90%8D%E4%B8%BAjava%E7%9A%84pid.hprof%0A *%0A *%0A * @author jack%0A * -Xms2m -Xmx2m -Xss160k -XX:+PrintHeapAtGC -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintGCDateStamps%0A *  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/Users/zhuhuihui%0A *
 %0A * 

add jvm study