How to manually force a full garbage collection in Confluence

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

While we do not recommend manually tuning Garbage Collection (GC) properties, manually forcing a full GC when testing memory adjustments in a development environment may become necessary.

Solution

  1. First, you will need to run Confluence through a JDK from Java version 8 or higher. In Java 8+ JDK, the jcmd utility is accessed and used to initiate the full garbage collection. (You can find this command under your $JDK_HOME/bin/)
  2. Run a jcmd command to reveal all processes and their PIDS currently running on Confluence 

    jcmd
  3. Review the output of processes and notate the PID located for a process running under Tomcat Catalina. In the following example the PID is 12345 

    12345 org.apache.catalina.startup.Bootstrap start
  4. Using the PID from step 3., run the following command (where xxxx is PID) to trigger the full GC: 

    jcmd xxxx GC.run
  5. The process should run and generate the following execution message: 

    Command executed successfully
Last modified on Sep 30, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.