package jvm.gc;

/**
 * VM Args: -verbose:gc -Xmx20M -Xms20M -Xmn10M -Xlog:gc* -XX:SurvivorRatio=8
 * new objects by default will go to eden first, when eden has no enough space,
 * it will trigger minor gc, and move objects from eden to old generation.
 */
public class MemoryAllocationYoung {
    private static final int _1MB = 1024 * 1024;

    public static void  testAllocation() {
        byte[] a,b,c,d;
        a = new byte[2 * _1MB];
        b = new byte[2 * _1MB];
        c = new byte[2 * _1MB];
        d = new byte[4 * _1MB];

    }

    public static void main(String[] args) {
        testAllocation();
    }

}
