Too much memory consumed by AEM on Windows Server

AEM 6.0, 6.1 and 6.2 consumes too much memory on some versions of Windows Server

The Windows OS versions below have been identified as problematic:

  • OS name: Microsoft Windows Server 2008 R2 Enterprise (Version: 6.1.7601 Service Pack 1 Build 7601)
  • OS name: Microsoft Windows Server 2012 Standard (Version: 6.2.9200 Build 9200)

Symptoms: During times of high write activity (for example, during a large package install) could result in using most of the native memory if memory mapped I/O is enabled.

You may see a gradual increase in the working set memory.  Memory usage increases, but memory isn't released for other processes to use. This problem is an issue with Windows memory management, rather than Adobe Experience Manager.

  1. Disable memory mapping all together, by adding tarmk.mode=32 org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg forces tarMK not to use memory mapping. Since windows server 2012 has deprecated the WSRM service, only disabling the memory mapping helps.

  2. Enable WSRM (Windows System Resource Manager). Windows System Resource Manager (WSRM) on Windows Server 2008 allows you to control how CPU and memory resources are allocated to applications, services, and processes on the computer. Managing resources in this way improves system performance and reduces the chance that applications, services, or processes take CPU or memory resources away from one another and slow down the performance of the computer. Managing resources also creates a more consistent and predictable experience for users of applications and services running on the computer.

  3. AEM related tools

    When using AEM related tools, do not use the parameters that are leveraging the memory mapped files. For oak-run specifically, do not use the JVM parameter -Dtar.memoryMapped=true

Configure WSRM

  1. Enable the WSRM service (see http://technet.microsoft.com/en-us/library/cc753939.aspx).

  2. Create a policy to control resource that the Adobe Experience Manager service can consume. Right-click the Resource Allocation Policies container and chose New Resource Allocation Policy. The New Resource Allocation Policy dialog box appears, as shown below:

    policy
  3. Add a resource allocation entry.

    add_policy
  4. Add a matching process to apply the rule to. Select the registered CQ process.

    Add process
  5. Click OK to go back to New Process Matching criteria screen.

    process_acthing criteria window
  6. Click OK to get back to the Resource Allocation dialog with the new "CQ" Process selected.

    resourceAllocation

    The Memory tab allows us to limit the memory and here there are two options. The maximum committed memory limit is more to control apps that can have a memory leak and can be set up to stop or alert someone when the process goes above the configured limit. We can ignore that option but we want CQ to have a limited set of memory to work. Set it according to your limit. Likewise, you can set the CPU utilization as well. Click OK to finish.

    allocation-memory
  7. As a last to bring the policy into effect, right-click the newly created policy and select Set as Managing Policy.