簡體   English   中英

此gc日志中的完整gc或young gc?

[英]Full gc or young gc from this gc log?

我用macbook air測試了Java gc,並得到了這個gc日志,但是我不知道第2行是完整的gc還是年輕的gc?

[GC[DefNew: 7139K->146K(9216K), 0.0109670 secs] 7711K->6862K(19456K), 0.0109990 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
[GC[DefNew: 6377K->6377K(9216K), 0.0000150 secs][Tenured: 6715K->8763K(10240K), 0.0094290 secs] 13093K->12988K(19456K), [Perm : 3441K->3441K(21248K)], 0.0094930 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 

vm選項如下:

-Xms20M -Xmx20M -Xmn10M -XX:+UseSerialGC -XX:+PrintGCDetails

和我的測試源代碼:

    byte[] b1 = new byte[2 * 1024 * 1024];
    byte[] b2 = new byte[2 * 1024 * 1024];
    byte[] b3 = new byte[2 * 1024 * 1024];

    Thread.sleep(3000);
    System.out.println("after sleep 3 sec");

    byte[] b4 = new byte[2 * 1024 * 1024];
    System.out.println("after b4");

    byte[] b5 = new byte[2 * 1024 * 1024];
    byte[] b6 = new byte[2 * 1024 * 1024];
    System.out.println("after b6");
    /**
     *
     */
    byte[] b7 = new byte[2 * 1024 * 1024];

    Thread.sleep(3000);
    System.out.println("end");

謝謝你

編輯

我從此鏈接中獲得了一些信息

DefNew

那就是串行新一代收集器。 因此,這是次要的GC。

您可能要使用GCViewer可視化GC日志。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM