AEM either crashes with an OutOfMemoryError, is running constant java garbage collection or is showing high heap utilization. On analysis of a heap dump in Eclipse Memory Analyzer Tool, the top consumer of java heap, an AsyncIndexUpdate thread is consuming the most retained heap via an instance of org.apache.jackrabbit.oak.plugins.index.lucene.OakDirectory$OakIndexInput:
The issue can be fixed by enabling Copy on Write feature of the Lucene Index Provider in AEM following the below steps:
- Go to http://aem-host:port/system/console/configMgr and log in as admin
- Find the "Apache Jackrabbit Oak LuceneIndexProvider" configuration
- Enable the checkbox for "Enable CopyOnWrite"