Using garbage collection for memory management

The tactics and details of the garbage collection capability in your Java Virtual Machine (JVM) differ among JVM implementations from vendor to vendor. If garbage collection is not run often enough or is not successful enough at recovering unneeded memory, the JVM can fail with an out-of-memory exception. This could indicate a design or implementation flaw or that demand for virtual memory under the current workload exceeds supply.

Note: The Pega-RULES agent periodically forces some memory segments to be available for garbage collection, using the standard activity Code-.SystemCleaner.

Minimizing memory demand

Each requestor clipboard occupies virtual memory. Best practices for clipboard management include:

  • Releasing pages that are no longer needed with the Page-Remove method.
  • Limiting the maximum number of instances retrieved by an Obj-Browse method or a report definition rule.
  • Retrieving only needed properties in an Obj-Browse method, Obj-List method, or a report definition rule.

Using the Performance tool, you can monitor the size of your clipboard in bytes.

PEGA0028 Alerts

If garbage collection completes but fails to produce enough results, the system adds an alert of type PEG0028 to the Alert log.

PegaRULES Log Analyzer

You can use the PegaRULES Log Analyzer, a standalone Web application available from the Pega Exchange, to analyze GC logs. See PDN article Understanding the PegaRULES Log Analyzer.

Reduce garbage collection from System Management Application

On a multinode cluster, or on a production system with a single node, install the System Management application on an application server (and JVM) separate from those where Pega Platform runs. Even when the System Management application is not used frequently, sharing an application server can cause frequent and unwanted garbage collection operations that can affect performance.

Additional resources

JVM settings can affect the performance of your system. For information about JVM settings, use the Installation Guide for your platform, and see the PDN article JVM configuration best practices.