What versions of java are slow for gc logging?

I was informed that some versions of java have a significant performance impact when we include -verbose:gc . However, I cannot understand if this is so or not.

Was this recording slow (ish) at some point, and when did it stop?

The reason I ask is because some doubts concern the application of this to the production environment to investigate potential memory leaks (and can we stop doing periodic system reboots ...).

In particular, I'm talking about Java 1.4.2, which I think presented an argument and which service pack it applies to.

+4
source share
2 answers

I suggest you do the following:

  • Write a guideline that is likely to emphasize garbage collection. (Create large related data structures with weak links, etc. Etc.).

  • Install a copy of the same version of the JVM that you use when creating on any test field.

  • Run the test with various GC registration settings, including the parameters that you want to run during production, and evaluate the impact of performance on the benchmark.

If you do it right, it will give you some convincing evidence of how your production server will have a positive effect.

+4
source

I know that you asked about the effect of verbose: gc (Amir is correct), but based on the comments that, as I see it, you are investigating a memory leak.

Is it possible to get a histogram of your environment? A detailed GC will show you that there is a memory leak, not where the memory sits.

You mentioned java 1.4.2, is this your current version? If you use 1.5 or higher, you can use

 jmap -histo <pid> > file.txt 

This will give you a breakdown of all the objects in memory. You freeze your JVM for a time depending on the amount of memory in the system. (2 GB can freeze for a minute or so even on good hardware) first check this on the development system. I know that you do not want to influence your work environment, but it is a necessary evil to find the source of the problem. Take a grip right before a periodic restart to trim your impact.

+5
source

All Articles