我運行一個簡單的程序與標誌-Xloggc:./gc-$$.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps
和所有它輸出是JVM忽略GC日誌記錄標誌?
Heap
def new generation total 4928K, used 642K [0x04760000, 0x04cb0000, 0x09cb0000)
eden space 4416K, 14% used [0x04760000, 0x04800b38, 0x04bb0000)
from space 512K, 0% used [0x04bb0000, 0x04bb0000, 0x04c30000)
to space 512K, 0% used [0x04c30000, 0x04c30000, 0x04cb0000)
tenured generation total 10944K, used 0K [0x09cb0000, 0x0a760000, 0x14760000)
the space 10944K, 0% used [0x09cb0000, 0x09cb0000, 0x09cb0200, 0x0a760000)
compacting perm gen total 12288K, used 1588K [0x14760000, 0x15360000, 0x18760000)
the space 12288K, 12% used [0x14760000, 0x148ed008, 0x148ed200, 0x15360000)
No shared spaces configured.
(我已經嘗試添加-verbose:gc
也)
我跳拿到實際工作GC統計,如:
581.146: [Full GC [PSYoungGen: 170752K->0K(341376K)] [PSOldGen: 786611K->786713K(919552K)] 957363K->786713K(1260928K) [PSPermGen: 19076K->19076K(29184K)], 3.4611450 secs]
584.691: [Full GC [PSYoungGen: 170752K->0K(341376K)] [PSOldGen: 786713K->786759K(919552K)] 957465K->786759K(1260928K) [PSPermGen: 19076K->19076K(27648K)], 3.4172340 secs]
找不到我做錯了什麼。我正在使用
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode
錯誤的標誌?
標誌看起來不錯。你確定GC在運行嗎?也許它只是沒有機會開始。 – apangin
好點。將運行適當的測試。 – filippo
@apangin這應該是一個答案,讓它如此。 – Eugene