package jvm.gc;

public class ReferenceCountingGC {

    private ReferenceCountingGC referenceCountingGC;

    private int OneMB = 1024 * 1024;

    private byte[] bigSize = new byte[1 * OneMB];

    public static void testGC() {
        ReferenceCountingGC objA = new ReferenceCountingGC();
        ReferenceCountingGC objB = new ReferenceCountingGC();
        objA.referenceCountingGC = objB;
        objB.referenceCountingGC = objA;

        objA = null;
        objB = null;
        System.gc();
        System.out.println("finish GC");
    }



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