How can I create rolling gc.log files?

Solution Verified - Updated -

Issue

  • The JVM's are infrequently started and our GC files can get extremely large. I would like to be able to create "daily" gc logs somehow without having to restart the JVM. It would be nice if my nightly script could somehow detach the gc file from the running JVM process, create a new GC file and then somehow re-attach the file to the existing JVM process.
  • The size of the gc log is increasing. How can we reduce or partition gc logs? Or can we disable that logging?
  • How to rotate the gc.log in JBoss?

Environment

  • Red Hat Enterprise Linux (RHEL)
    • 7.x
  • OpenJDK 8
  • OpenJDK 11

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content