50,538
社区成员
发帖
与我相关
我的任务
分享
操作系统:Mac OS X 10.11.6 EI Capitan
Java环境: java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
public class BlankedClassSize {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
-verbose:gc -XX:+UseSerialGC -XX:+PrintGCDetails -Xmx20M -Xms20M -Xmn10M
Heap
def new generation total 9216K, used1164K [0x00000007bf000000, 0x00000007bfa00000, 0x00000007bfa00000)
eden space 8192K, 14% used [0x00000007bf000000, 0x00000007bf1231d0, 0x00000007bf800000)
from space 1024K, 0% used [0x00000007bf800000, 0x00000007bf800000, 0x00000007bf900000)
to space 1024K, 0% used [0x00000007bf900000, 0x00000007bf900000, 0x00000007bfa00000)
tenured generation total 6144K, used 0K [0x00000007bfa00000, 0x00000007c0000000, 0x00000007c0000000)
the space 6144K, 0% used [0x00000007bfa00000, 0x00000007bfa00000, 0x00000007bfa00200, 0x00000007c0000000)
Metaspace used 2666K, capacity 4486K, committed 4864K, reserved 1056768K
class space used 289K, capacity 386K, committed 512K, reserved 1048576K
public class MinorGC {
private static final int_1MB = 1024*1024;
public static void main(String[] args) {
// TODO Auto-generated method stub
testEdenGC();
}
public static void testEdenGC(){
byte[] allocation1,allocation2,allocation3,allocation4,allocation5,allocation6;
allocation1=newbyte[_1MB];
allocation2=newbyte[_1MB];
allocation3=newbyte[_1MB];
allocation4=newbyte[_1MB];
allocation5=newbyte[_1MB];
allocation6=newbyte[_1MB];
}
}
-verbose:gc -XX:TenuringThreshold=1 -Xms20M -Xmx20M -Xmn10M -XX:SurvivorRation=3 -XX:+PrintGCDetails -XX:+UseSerialGC
[GC (Allocation Failure) DefNew: 6029K->1354K(8192K), 0.0032985 secs] 6029K->5450K(18432K), 0.0033216 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
Heap
def new generation total 8192K, used 2440K [0x00000007bec00000, 0x00000007bf600000, 0x00000007bf600000)
eden space 6144K, 17% used [0x00000007bec00000, 0x00000007bed0f748, 0x00000007bf200000)
from space 2048K, 66% used [0x00000007bf400000, 0x00000007bf5529b0, 0x00000007bf600000)
to space 2048K, 0% used [0x00000007bf200000, 0x00000007bf200000, 0x00000007bf400000)
tenured generation total 10240K, used 4096K [0x00000007bf600000, 0x00000007c0000000, 0x00000007c0000000)
the space 10240K, 40% used [0x00000007bf600000, 0x00000007bfa00040, 0x00000007bfa00200, 0x00000007c0000000)
Metaspace used 2666K, capacity 4486K, committed 4864K, reserved 1056768K
class space used 289K, capacity 386K, committed 512K, reserved 1048576K
public class MinorGC {
private static final int_1MB = 1024*1024;
public static void main(String[] args) {
// TODO Auto-generated method stub
testAllocation();
}
public static void testAllocation(){
byte[] allocation1,allocation2,allocation3,allocation4;
allocation1 = newbyte[2*_1MB];
allocation2 = newbyte[2*_1MB];
allocation3 = newbyte[2*_1MB];
allocation4 = newbyte[4*_1MB];
}
}
-verbose:gc -Xms16M -Xmx16M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:+HeapDumpOnOutOfMemoryError -XX:MaxTenuringThreshold=15 -XX:+UseSerialGC
[GC (Allocation Failure) [DefNew (promotion failed) : 7144K->7474K(9216K), 0.0028055 secs][Tenured: 4096K->4096K(6144K), 0.0015627 secs] 7144K->6473K(15360K), [Metaspace: 2660K->2660K(1056768K)], 0.0044048 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
Heap
def new generation total 9216K, used 6555K [0x00000007bf000000, 0x00000007bfa00000, 0x00000007bfa00000)
eden space 8192K, 80% used [0x00000007bf000000, 0x00000007bf666ed0, 0x00000007bf800000)
from space 1024K, 0% used [0x00000007bf900000, 0x00000007bf900000, 0x00000007bfa00000)
to space 1024K, 0% used [0x00000007bf800000, 0x00000007bf800000, 0x00000007bf900000)
tenured generation total 6144K, used 4096K[0x00000007bfa00000, 0x00000007c0000000, 0x00000007c0000000)
the space 6144K, 66% used [0x00000007bfa00000, 0x00000007bfe00020, 0x00000007bfe00200, 0x00000007c0000000)
Metaspace used 2666K, capacity 4486K, committed 4864K, reserved 1056768K
class space used 289K, capacity 386K, committed 512K, reserved 1048576K