---
title: Garbage collector configuration reference
description: The following table provides guidance for configuring the garbage collector.
component: pingaccess
version: 9.0
page_id: pingaccess:reference_guides:pa_garbage_collector_config_ref
canonical_url: https://docs.pingidentity.com/pingaccess/9.0/reference_guides/pa_garbage_collector_config_ref.html
revdate: January 12, 2024
---

# Garbage collector configuration reference

The following table provides guidance for configuring the garbage collector.

Selecting the appropriate garbage collector depends on the size of the heap and available CPU resources. The following is a table of available collectors and some general guidance on when and how to use them.

Specify the garbage collector using the `jvm-memory.options` file located in the `<PA_HOME>/conf` directory. Modify the parameter beneath `#Use the parallel garbage collector` using the information provided below:

| Garbage Collector           | Description                                                                                                                                                                                                                          | Modifications                                                                                                                                                                                                                                                        |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Parallel                    | * Best used with heaps 4GB or less

* Full stop-the-world copying and compacting collector

* Uses all available CPUs, by default, for garbage collection                                                                            | Default collector for server Java Virtual Machine (JVM) *(tooltip: \<div class="paragraph">&#xA;\<p>A virtual machine that allows a computer to run Java programs and programs that are compiled to Java bytecode.\</p>&#xA;\</div>)*. No modification is required.  |
| Concurrent Mark Sweep (CMS) | - Best for heaps larger than 4GB with at least 8 CPU cores

- Mostly a concurrent collector

- Some stop-the-world phases

- Non-compacting

- Can experience expensive, single threaded, full collections due to heap fragmentation | Set to `‑XX:+UseConcMarkSweepGC` in the `jvm-memory.options` file.                                                                                                                                                                                                   |
| Garbage First (G1)          | * Best for heaps larger than 6GB with at least 8 CPU cores

* Combination concurrent and parallel collector with small stop-the-world phases

* Long-term replacement for CMS collector, does not suffer heap fragmentation like CMS | Set to `‑XX:+UseG1GC` in the `jvm-memory.options` file. Also disable `#Minimum size for the Young Gen space` and `#Maximum size for the Young Gen space` tuning. Explicit sizing adversely affects pause time goal. To disable, comment the lines out in the script. |
