Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java verbose:gc How to read the output?

I have a Java application which has some performance issues and someone recommend me to run it in verbose:gc mode. This has been done, but I don't know how to interpret the logging. Is it possible to explain me what it all means or to advise me as what I can do to increase performance?

Output log can be found on : http://pastebin.com/uDNPEGcd

Thanks in advance, Kind regards, Maarten

like image 641
Maarten Kesselaers Avatar asked Aug 09 '12 18:08

Maarten Kesselaers


People also ask

How do you Analyse verbose GC logs?

To help you visualize and analyze the GC, you can feed verbose GC log files into various diagnostic tools and interfaces. Examples include tools such as Garbage Collection and Memory Visualizer (GCMV) and online services such as GCEasy.

What does verbose GC mean?

The important argument here is the -verbose:gc, which activates the logging of garbage collection information in its simplest form. By default, the GC log is written to stdout and should output a line for every young generation GC and every full GC.

What should I look for in GC logs?

Log files can reveal when GC last ran, how long the process lasted, how many objects were promoted, how much memory was reclaimed, and other useful information.


1 Answers

verbose:gc prints right after each gc collection and prints details about each generation memory details. Here is blog on how to read verbose gc

If you are trying to look for memory leak, verbose:gc may not be enough. Use some visualization tools like jhat (or) visualvm etc.,

 4416K->512K(4928K), 0.0081170 secs

Before GC used memory is 4416K
After GC used memory is 512K
Total allocated memory is 4928K
like image 193
kosa Avatar answered Oct 02 '22 02:10

kosa