Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Any effective way of rotating gc.log

846658Mar 11 2011 — edited Mar 11 2011
Hi

The JVM option -Xloggc:gc.log
Version : Java 1.6

Issue replication :

A fresh gc.log
=========

$ file gc.log
gc.log: ASCII text, with very long lines

After nullyfying the gc.log file
==============

$ cat /dev/null > gc.log

file gc.log
gc.log: data

Try to open the file
=============

$ less gc.log
"gc.log" may be a binary file. See it anyway?

you get all kinds of null characters in the beginning of the file.

The only way to read the file is via tail.

Does JVM has any option for effectively rotating gc.log file without introducing null characters.


-- Jeljo
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 8 2011
Added on Mar 11 2011
2 comments
1,002 views