CRX disk and memory monitoring shuts down the repository too aggressively


CRX automatically shuts down the repository due to a monitoring feature introduced in CRX hotfixpack for CRX [1].

In the logs you see information like:

xx.xx.xxxx xx:xx:xx *ERROR* OutOfMemoryMonitor: stdev of memory usage samples is x.x, which is lower than 2. shutting down (, line 121)
xx.xx.xxxx xx:xx:xx *ERROR* LowDiskSpaceMonitor: More than 95 usage and stdev less than 2. (, line 165)
More than 95 usage and stdev less than 2.
More than 95 usage and stdev less than 2.

But according to the java garbage collection logs, the instance doesn't show abnormal memory usage.


There are a couple of system properties you can use to control this monitoring:

It is then recommended to try to increase the default setting with these JVM parameters:

-Dcrx.memoryMaxUsage=98 -Dcrx.memoryMinStdev=1

To completely disable this memory monitoring feature you can use this JVM parameter (this will allow the java process to throw an OutOfMemoryError):


To add these JVM parameters to your CQ or CRX startup you can add them to the end of the CQ_JVM_OPTS variable values in your start script.  This script can be found under crx-quickstart/server/start (CRX1.x,CRX2.0-2.2,CQ5.2.x,CQ5.3,CQ5.4) or crx-quickstart/bin/start (CRX2.3,CQ5.5 or later).

Also in Apache Felix Web console you can enable a feature to trigger a memory dump when a threshold percentage of memory usage is hit.  For example you could set it to 97% which would help you to see if there is a memory leak without actually allowing the java process to throw an OutOfMemoryError.

See this page on your instance at http://localhost:4502/system/console/memoryusage to set the Automatic Heap Dump Threshold value.

For more details on this topic see here for CRX2.2 [1] and here for CRX2.3 [2].

Applies to

CRX 2.2

CRX 2.3