package com.willlee.memory;

import java.util.ArrayList;

/**
 * ËùÓÐ¶ÔÏóµÄÊµÀý·ÖÅä¶¼ÔÚJava¶ÑÉÏ·ÖÅäÄÚ´æ£¬¶Ñ´óÐ¡ÓÉ-XmxºÍ-XmsÀ´µ÷½Ú
 * ¼ÓÉÏJVM²ÎÊý-verbose:gc -Xms10M -Xmx10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:+HeapDumpOnOutOfMemoryError£¬¾ÍÄÜºÜ¿ì±¨³öOOM£º
 * @author Administrator
 * 
 */
public class JavaHeap {
	static class OOMObject {
	}

	public static void main(String[] args) {
		ArrayList<OOMObject> list = new ArrayList<OOMObject>();
		while (true) {
			list.add(new OOMObject());
		}
	}
}
