Leftover memory segments that are no longer needed are an ordinary byproduct of Java processing. Each JVM includes a feature that identifies and gathers these segments, making the virtual memory space available for later use.
Known as garbage collection, the tactics and details of this capability differ among JVM implementations from Sun Microsystems, IBM, and others. If such garbage collection is not run often enough or is not successful enough at recovering unneeded memory, the JVM may fail with an out-of-memory exception. This may indicate a design or implementation flaw, or may only indicate that demand for virtual memory under the current workload exceeds supply.
The Pega-RULES agent periodically forces some memory segments to be available for garbage collection, using the standard activity Code-.SystemCleaner.
JVMs can support verbose logging of garbage collection
operations, allowing skilled IT staff to review and analyze details of
memory usage. An optional prconfig.xml
setting identifies
the directory into which verbose garbage collection output. For
example:
<env name="GarbageCollection/Logfile" value="C:\pegarules\logs" />
This directory must match the location supplied with the verbose GC option to the JVM.
Each Process Commander requestor's clipboard occupies virtual memory. Good clipboard management practices include:
Using the Performance tool, you can monitor the size in bytes of your clipboard.
If garbage collection completes but fails to produce enough results, the system adds an alert of type PEG0028 to the Alert log.
You can use the PegaRULES Log Analyzer, a standalone Web application available from the Pega Exchange, to analyze GC logs. See PDN articles PRKB-25406 Understanding the PegaRULES Log Analyzer
On a multinode cluster, or on a production system with a single Process Commander node, install the System Management application on an application server (and JVM) separate from those where PRServlet runs. Even when the System Management application is lightly used, when sharing an application server it can cause frequent and unwanted garbage collection operations that can affect performance. STEWS SMA Ref
JVM settings can affect performance of your system. For guidance on JVM settings, use the Installation Guide for your platform, and see these Pega Developer Network articles:
Java Virtual Machine, PegaRULES Log Analyzer | |
About the
Performance tool Page-Remove method Understanding Alerts |