package gc; public class GcTest { private static final int _1MB= 1024 * 1024; public static void main(String[] args) { byte[] a1, a2, a3, a4; a1 = new byte[2 * _1MB]; a2 = new byte[2 * _1MB]; a3 = new byte[2 * _1MB]; a4 = new byte[2 * _1MB]; } }
D:\study\workspace\jvm\src>java -Xms20M -Xmx20M -Xmn10M -XX:Survivor Ratio=8 -XX:+PrintGCDetails -Xloggc:d:\gc.log gc.GcTest