标签:复制算法 .com 阶段 并且 类的方法 应用 类型 static live
public class ReferenceCountingGC {
public Object instance = null;
// 占点内存,以便在GC日志中看清楚是否被回收过
private static final int _1MB = 1024 * 1024;
private byte[] bigSize = new byte[2 * _1MB];
public static void testGC() {
ReferenceCountingGC objA = new ReferenceCountingGC();
ReferenceCountingGC objB = new ReferenceCountingGC();
objA.instance = objB;
objB.instance = objA;
objA = null;
objB = null;
System.gc();
}
}


标签:复制算法 .com 阶段 并且 类的方法 应用 类型 static live
原文地址:http://www.cnblogs.com/wttttt/p/7290932.html