Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know if the PrintGCDetails affects java performance much? I've been monitoring our java garbage collecting on a staging server with the same setup as the production server.

I assumed it was safe to say that I shouldn't have this enabled on production but I don't know if there's really any affect on performance.

share|improve this question

You should definitely enable garbage collection logging in production servers. The benefits far outweigh the negligible performance impact.

You could also monitor GC behaviour using other approaches (see answers).

share|improve this answer

Depending how much your java application logs to disk be very careful that you don't start to see performance issues due to disk IO, i have seen this happen with a couple of different java application where the system works well until it gets bogged down performing logging.

Might be worth looking into using jmx to query how the system is running or enabling SNMP within the JVM ( i have tested this but not used it in production so please use very carefully and test some where before hand.)

share|improve this answer

It will at worst have a minor effect on performance. It depends on how your application behaves. If it requires the garbage collector to run more often then it will be outputting more logging information. The act of logging it doesn't really take much time, but it will fill your log files with a lot of extra information.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.