JVM学习之GC日志

-XX:+PrintGCDateStamps -XX:+PrintGCDetails -Xloggc:d:/gc_log/gc.log



package com.tets;
public class ReferenceCountingGC {
	 public Object instance = null;
	    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();
	        System.out.println("--------------");

	    }

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


2017-08-30T22:03:53.744+0800: 1.202: [GC 1.210: [DefNew: 2505K->170K(4928K), 0.0270798 secs] 2505K->2219K(15872K), 0.0353489 secs] [Times: user=0.00 sys=0.00, real=0.04 secs] 
2017-08-30T22:03:53.779+0800: 1.238: [Full GC (System) 1.238: [Tenured: 2048K->170K(10944K), 0.0548002 secs] 4267K->170K(15872K), [Perm : 2335K->2335K(12288K)], 0.0554659 secs] [Times: user=0.01 sys=0.00, real=0.06 secs] 
Heap
 def new generation   total 4992K, used 96K [0x04510000, 0x04a70000, 0x09a60000)
  eden space 4480K,   2% used [0x04510000, 0x04528028, 0x04970000)
  from space 512K,   0% used [0x04970000, 0x04970000, 0x049f0000)
  to   space 512K,   0% used [0x049f0000, 0x049f0000, 0x04a70000)
 tenured generation   total 10944K, used 170K [0x09a60000, 0x0a510000, 0x14510000)
   the space 10944K,   1% used [0x09a60000, 0x09a8abd0, 0x09a8ac00, 0x0a510000)
 compacting perm gen  total 12288K, used 2347K [0x14510000, 0x15110000, 0x18510000)
   the space 12288K,  19% used [0x14510000, 0x1475af30, 0x1475b000, 0x15110000)
No shared spaces configured.








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值