I found the JVM flags here. Is there a more detailed explaination of what exactly they do?
What do -XX:-PrintGC and XX:-PrintGCDetails flags do?
Asked Answered
Setting this flags writes all the garbage collections made by the JVM to a log file (or stdout, but then it is less useful), and these can be analysed by tools such as the ones mentioned here. Using this information you can fine tune your garbage collection configuration.
Using the above mentioned flags, is it possible to get the details of previous GC cycles (of time when these flags were not set)? –
Basis
What do you mean by "previous GC cycles"? –
Dallman
Rather on Sun's, use -Xloggc:gc.log
to log to a file, -verbose:gc
is also a common switch for this.
Also, ensure -XX:+PrintGCDetails
and -XX:+PrintGCTimeStamps
(note the plus + sign). The timestamp switch is redundant but good to include.
would you elaborate what -verbose:gc does? Since this answer is confusing for those who are trying to get some help. And upvoters must be only those who already know this. –
Bulge
@SyedAqeelAshiq seems a bit mean about the upvotes...but
-verbose:gc
is a mechanism to log Garbage Collection events in a verbose manner by which they can be parsed and post- or runtime-evalutated as to the required VM ergonomics. :-) –
Immortality Purpose of SO is to provide high quality answers, to those who want to get some help. I was searching for PrintGC flag, but this answer confused me, and had to spend few hours finding difference between PrintGC and verbose:gc. Perhaps you should update your answer to mention the difference. And add complete sentences. –
Bulge
This does not answer the question - what is the difference between those two options? –
Outrelief
-verbose:gc
is an alias for -XX:+PrintGC
; see #49609551 –
Hiding © 2022 - 2024 — McMap. All rights reserved.