Send JVM -verbose output to stderr instead of stdout
I'm running java with the -verbose:gc
option to measure garbage collector behavior, but it sends the info to stdout
, mixing with my program's normal output. How do I tell it to output this info to st开发者_StackOverflowderr
?
On HP-UX -Xverbosegc [:help] | [0 | 1] [:file = [stdout | stderr | ]]
IBMs JDK Any platform that uses the IBM JDK
-Xverbosegclog[:[,,]]
Sun JDK -Xloggc:file Report on each garbage collection event, as with -verbose:gc, but log this data to file. In addition to the information -verbose:gc gives, each reported event will be preceeded by the time (in seconds) since the first garbage-collection event. Always use a local file system for storage of this file to avoid stalling the JVM due to network latency. The file may be truncated in the case of a full file system and logging will continue on the truncated file. This option overrides -verbose:gc if both are given on the command line.
精彩评论