Controlling the collection of garbage collection information (Java applications only)

By default, Health Center collects only basic data about garbage collection. For Java™ applications, you can retrieve more detailed information by enabling the collection of data such as object allocations. You can use this information to identify memory leaks and generate tuning recommendations. You can also save garbage collection information to a file, which you can analyze later in a different tool such as IBM® Monitoring and Diagnostic Tools - Garbage Collection and Memory Visualizer.

Before you begin

You must have connected the Health Center client to a running Health Center agent. The Monitored System menu options are not available when you are viewing data from a saved file.


  1. Click Monitored System > Garbage Collection and allocation data collection....
    The GC Data Collection Settings dialog window opens.
  2. Optional: To save garbage collection data to a file, select Write verbose GC data to file.

    A message window opens, and shows the location of the file that Health Center will use to store the verbose garbage collection data. The file name is verbosegc_ process_id_n.log, where process_id is the process ID of the monitored JVM and n is a sequence number. The file is saved in a directory that is local to the monitored JVM specified by the property. If this property is not set, the file is saved in the directory that is specified by the user.dir system property.

  3. Optional: If you want to see the call hierarchy for sampled allocation requests, select Enable collection of call stacks for sampled object allocation events
    This information is displayed in the Samples by request site view in the garbage collection perspective
  4. Optional: If you want to analyze the allocations of objects within a specified size range, select Enable collection of object allocation events within thresholds.
    This information is displayed in the Object allocations view in the garbage collection perspective.
    1. Enter values in either Low threshold (bytes) or High threshold (bytes), or in both fields. Data for allocations of objects that fall within this range is collected.
      For example, if you specify a low threshold of 1 MB, and no high threshold, data is collected for objects that are larger than 1 MB.
      You can specify the threshold values by using bytes, kilobytes, or megabytes. Use the following format:
       value [k|m]
      value is the numeric value of the threshold, k is an optional indicator for kilobyte, and m is an optional indicator for megabyte. For example:
      4096 = 4096 bytes
      830k = 830 KB
      2m = 2 MB
      If you do not specify any values, no data is collected.
  5. Optional: If you want to limit the collection of call hierarchy data for object allocation and allocation sampling, select a value for Maximum number of stack entries to collect per event.
    This setting controls the stack trace depth that is collected for all events in Health Center. The default value is 5.
  6. Click Finish.

What to do next

Use the garbage collection perspective to analyze the data. For more information, see Garbage collection perspective. If you chose to save garbage collection data to a file, you can import the file into IBM Monitoring and Diagnostic Tools for Java - Garbage Collection and Memory Visualizer, for more detailed analysis. More information about this tool is available in IBM Knowledge Center.