Troubleshoot memory consumption issues

If your Oracle GoldenGate Extracts or Replicats run out of memory when running long transactions, then you must configure Cache Manager properly for each process.

The default cache size setting of 64 GB is fine in most cases. An issue arises when you process extremely large transactions or your deployment shape is small relative to the transaction size you're processing.

Depending on the shape of the OCI GoldenGate deployment, 16 gigabytes (GB) of physical memory is allocated per OCPU. If autoscale was enabled, then the total physical memory can be up to 3 times more.

For example, an OCI GoldenGate deployment with 4 OCPUs (4 x 16 GB = 64 GB) and autoscale enabled (64 GB x 3) has 192 GB of physical memory available.

By default, each OCI GoldenGate deployment is allocated 256 GB of swap space. Therefore, your total virtual memory for the deployment is 192 GB + 256 GB = 448 GB. Considering that all GoldenGate proceses in the deployment share this virtual memory, Oracle recommends that you set CACHEMGR CASHESIZE to a safe range, such as 60% of the total virtual memory, or 268 GB. Once the Extract or Replicat reaches 268 GB virtual memory usage, overflow transactions are written to disk, which defaults to /u03/temp. This default directory has 256 GB available. If that's still not enough space, then you can add a secondary directory. Oracle recommends /u02/Deployment/var/lib/cachemanager, which is unlimited.

CACHEMGR CACHESIZE 268G CACHEDIRECTORY /u03/temp, CACHEDIRECTORY /u02/Deployment/var/lib/cachemanager

If you have multiple Extracts and Replicats that process large transactions in the same deployment, then you can choose from the following options:

  • Increase the deployment's OCPUs so that you have more physical memory and results in more virtual memory for your processes to use.
  • Decrease the CACHEMGR CACHESIZE setting so that each process uses less virtual memory and force the overflow to use the disk directories. This lets you keep the current deployment shape without the increase cost. However, your large transaction processing will be slightly slower as it uses disk instead of virtual memory to cache the pending transactions.

You can use the parameters and recommendations mentioned here to help fine tune your environment settings to your transaction size.