Pivotal Knowledge Base


Enabling garbage collection logging with Tomcat on Windows platform (2009563)

Enabling garbage collection logging with Tomcat on Windows platform (2009563)


This article provides steps to enable garbage collection logging with Apache Tomcat or Pivotal tc Server Runtime on the Windows platform. In all these cases, you need to add options to the Java executable, but the method may vary for each product. The same method can be used for specifying other Java options.


Note: For each product, the example assumes that the GC log should go in the same standard location as other logs. You may need to adjust the examples for your own situation.

Apache Tomcat

To enable garbage collection logging with Apache Tomcat:
  1. Execute the tomcat6w.exe (tomcat5w.exe for Tomcat 5.5.x) application. This displays a configuration for the Apache Tomcat Windows service.
  2. Click the Java tab.
  3. Add the following options to the Java Options section:


    Note: You must specify the full path to the log file. In this example, the full path is C:\apache\apache-tomcat-6.0.32\logs\gc.log.

  4. Switch back to the General tab.
  5. Restart the service.

    To restart the service, click Stop and then click Start. Garbage collection logging should now be enabled.

tc Server Runtime

To enable garbage collection logging under tc Server:
  1. Open the conf/wrapper.conf file for an instance of the runtime using a text editor.
  2. Locate the lines that start wrapper.java.additional. These lines are numbered from 1 to X where X is the highest number and the numbers from 1 to X are consecutive. For example:


    Note: The default configuration should run from 1 to 10.

  3. To enable garbage collection logging, add lines which contain the additional properties, making sure to increment the numbers for each line. For example, assuming that the original wrapper.java.addition parameters stop at 10, the additional lines are similar to:


  4. Restart your instance to enable garbage collection logging.


©Pivotal 2013


Powered by Zendesk