You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs/hybrid/v1.8/cassandra-production). info

> [!NOTE]
> **Note:** The instructions in this document apply to Apigee Edge for Private Cloud 4.53.01 and earlier. For Edge for Private Cloud 4.54.00 or later, see [Configure
> the garbage collector on Message Processors](https://docs.apigee.com/private-cloud/v4.54.00/configuring-gc-message-processors-4.54).


This document explains how to enable
[Garbage First Garbage Collector](https://www.oracle.com/technetwork/java/javase/tech/g1-intro-jsp-135488.html) (G1GC) on the Apigee Edge's Message Processors.


Apigee Edge's Message Processor runs on Java Virtual Machine (JVM) and uses the default Garbage
Collector---serial or parallel depending on the hardware and operating system configurations.
Under certain circumstances and based on your needs, you may want to change the Garbage Collector
type used on the Message Processor.


The G1GC is the low-pause, server-style generational garbage collector for Java HotSpot VM which
improves the overall performance of the Message Processor. Typically, it is designed for
applications with medium-sized to large-sized data sets in which response time is more important
than overall throughput. For example: You can consider using G1GC if the heap size is big
(greater than 3GB).


It is generally recommended to set another JVM parameter `UseStringDeduplication`along
with G1GC. This parameter optimizes the Java heap memory usage by making the duplicate or identical
String values share the same character array.

## Before you begin

- If you aren't familiar with Garbage collection and different types of Garbage Collectors in Java, read [Java Garbage Collection Basics](https://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html).
- If you aren't familiar with G1GC, read [Getting started
  with the G1 Garbage Collector](https://www.oracle.com/technetwork/tutorials/tutorials-1876574.html).
- If you aren't familiar with configuring properties for Edge on Private Cloud, read [How to configure
  Edge](https://docs.apigee.com/private-cloud/v4.50.00/how-configure-edge).

## Enabling G1GC on the Message Processors

This section explains how to enable G1GC on the Edge Message Processor. G1GC can be enabled
through the property `useG1GC` on the Message Processor component. By default, this
property is set to `false` on the Message Processors. To configure any property on the Message
Processor, use the token according to the syntax described in
[How to configure Edge](https://docs.apigee.com/private-cloud/v4.50.00/how-configure-edge).


To enable G1GC on the Message Processors, perform the following steps:

1. [Locate token for useG1GC property](https://docs.apigee.com/how-to-guides/enabling-g1gc-message-processors#useG1GCtoken)
2. [Enable G1GC on Message Processor](https://docs.apigee.com/how-to-guides/enabling-g1gc-message-processors#enableG1GC-on-mp)

> [!TIP]
>
> **Required permissions:** To perform this task, you must have the following permissions:
>
> - Access to the specific Message Processors where you would like to configure the G1GC.
> - Access to create and edit the Message Processor component properties file in the `/opt/apigee/customer/application` folder.

### Locate token for useG1GC property


The following steps describe how to locate the token for useG1GC property:

1. Search for the `useG1GC` property in the Message Processor source directory `/opt/apigee/edge-message-processor/source` using the following command:

   ```
   grep -ri "useG1GC" /opt/apigee/edge-message-processor/source
   ```
2. The output of this command shows the token for Message Processor's property `useG1GC` as follows:

   ```
   /opt/apigee/edge-message-processor/source/conf/system.properties:useG1GC={T}conf_system_useG1GC{/T}
   ```


   Where the string between the `{T}{/T}` tags is the name of the token that you
   can set in the Message Processor's `.properties` file. Thus, the token for the
   property `useG1GC` is as follows:

   ```
   conf_system_useG1GC
   ```

### Enable G1GC on the Message Processors


The following steps describe how to enable G1GC on the Apigee Message Processors:

1. Open the `/opt/apigee/customer/application/message-processor.properties` file on the Message Processor machine in an editor. If the file does not already exist, then create it. For example:

   ```
   vi /opt/apigee/customer/application/message-processor.properties
   ```
2. Add the following line to this file:

   ```
   conf_system_useG1GC=true
   ```
3. Save your changes.
4. Ensure this properties file is owned by the `apigee` user. For example:

   ```
   chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
   ```
5. Restart the Message Processor using the following command:

   ```
   /opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
   ```
6. If you have more than one Message Processor, repeat these steps on all the Message Processors.

## Verifying G1GC Configuration on the Message Processors


This section explains how to verify that the G1GC configuration has been successfully modified
on the Message Processors.


Even though you use the token `conf_system_useG1GC` to enable G1GC on the Message
Processor, you need to verify that the actual property `useG1GC` has been set with
the new value as follows:

1. Search for the property `useG1GC` in the `/opt/apigee/edge-message-processor/conf` directory and check to see that it has been set with the new value. For example:

   ```
   grep -ri "useG1GC" /opt/apigee/edge-message-processor/conf
   ```
2. If the G1GC is enabled successfully on the Message Processor, then the previous command shows the new value in the `system.properties` file.


   The sample result from the previous command, after you have enabled G1GC on the Message
   Processor, is as follows:

   ```
   /opt/apigee/edge-message-processor/conf/system.properties:useG1GC=true
   ```


   In the example output, note that the property `useG1GC` has been set with the new value `true` in `system.properties`. This indicates that G1GC is successfully enabled on the Message Processor.
3. If you still see the old value for the property `useG1GC`, then verify that you have followed all the steps outlined in [Enabling G1GC on the Message Processors](https://docs.apigee.com/how-to-guides/enabling-g1gc-message-processors#enable=g1gc-mp) correctly. If you have missed any step, repeat all the steps again correctly.
4. If you are still not able to enable G1GC, contact [Apigee Edge Support](https://docs.apigee.com/api-platform/troubleshoot/support).

## What's next?


[Enabling String Deduplication on Message Processors](https://docs.apigee.com/how-to-guides/enabling-string-deduplication-message-processors)