Sunday, 4 December 2011

How to log Garbage collection in java?

You have to add the following parameters when running a java program
  • -XX:+PringGC - switching on summary of every run of Garbage collection
  • -XX:+PringGCDetails - switching on detail summary of every run of Garbage collection
  • -Xloggc:filename - filename to which logs will be put

No comments: