I test java gc with macbook air, and got this gc log, but I don't know it's full gc or young gc with line 2 ?
[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 options is below :
-Xms20M -Xmx20M -Xmn10M -XX:+UseSerialGC -XX:+PrintGCDetails
and my test source code :
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");
Thanks ahead.
EDIT
I get some information from this link
DefNew
That's the serial new gen collector. Thus it's a minor GC.
You may want to use GCViewer to visualize GC logs.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.