Ok, apangin got it right - my gc didn't have enought time to run. Made the program run a bit longer and I've got the propper logs.
JVM ignoring GC Logging flags?
-
04-07-2023 - |
Domanda
I am running a simple program with the flags -Xloggc:./gc-$$.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps
and all it outputs is
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.
(I've tried adding -verbose:gc
also)
I was hopping to get the actuall GC stats like:
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]
Can't find what I am doing wrong. I using
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
Wrong flags?
Soluzione 2
Altri suggerimenti
Your flags seem fine. This program triggered different output:
class Foo {
public static void main(String[] args) { System.gc(); }
}
Has output in the log file like
2014-05-10T01:20:41.896+0200: 0.054: [GC (System.gc()) [PSYoungGen: 379K->352K(1024K)] 379K->360K(128512K), 0.0007776 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow