Instance becomes unresponsive with OutOfMemoryError during BPA report execution in Experience Manager Assets
In Adobe Experience Manager Assets 6.1 and later, running a Best Practices Analyzer (BPA) report exhausts the JVM heap and leaves the instance unresponsive until you restart it. The logs show java.lang.OutOfMemoryError: Java heap space. To fix this, run BPA on a Stage environment or Production Author clone, confirm the memory error, analyze heap usage, and review JVM and garbage-collection settings before rerunning the report.
Description description
Environment
Adobe Experience Manager Assets 6.1 and later deployments with BPA installed and administrator access
Issue/Symptoms
When you run a Best Practices Analyzer (BPA) report on an AEM Assets instance, the instance becomes unresponsive. No pages are accessible until you restart the instance. The logs show java.lang.OutOfMemoryError: Java heap space.
- The issue recurs each time you run the BPA report.
- You must restart the instance to restore access.
- The error log shows that the JVM heap is exhausted during the operation.
Cause
The JVM heap is exhausted during BPA report execution. This produces java.lang.OutOfMemoryError: Java heap space and leaves the AEM instance unresponsive until you restart it.
Resolution resolution
To troubleshoot the memory issue and reduce the risk of recurrence, follow these steps:
-
Run BPA on a Stage environment that closely matches Production or on a clone of the Production Author environment instead of on a busy production author instance.
- Note: No BPA-specific setting is documented to prevent heap exhaustion during report generation.
-
Confirm that the instance became unresponsive because of an
OutOfMemoryError.- Search
error.logforOutOfMemoryErrorentries. - Confirm that the log contains java.lang.OutOfMemoryError: Java heap space.
- Identify the components that were active when the error occurred, such as the Oak asynchronous indexer, FileStore tasks, and schedulers.
- Search
-
If you manage the AEM JVM startup parameters, enable heap-dump capture.
- Ensure that AEM starts with the
-XX:+HeapDumpOnOutOfMemoryErrorJVM option. - After the error occurs, analyze the generated
.hproffile with Eclipse MAT to determine which objects consume the most memory. - Note: The
-XX:+HeapDumpOnOutOfMemoryErroroption captures diagnostic data after an OutOfMemoryError; it doesn’t prevent heap exhaustion. - For additional guidance, see Steps to resolve Memory related issues in AEM.
- Ensure that AEM starts with the
-
Review JVM memory and garbage collection.
- Use the AEM Web Console at
/system/console/memoryusageto inspect heap usage, particularly the Old or Tenured generation. - Review the garbage-collection logs to determine whether garbage collection runs frequently and whether full garbage collection reclaims sufficient memory.
- Use the AEM Web Console at
-
Schedule BPA and maintenance tasks during an off-peak or maintenance window.
- Schedule maintenance tasks such as revision cleanup, workflow purges, and reports during a controlled window to reduce memory pressure.
-
Review JVM heap and garbage-collection settings after analyzing the memory usage pattern.
- Adjust the JVM heap size or garbage-collection parameters only after completing the preceding checks.
- Review server sizing if the available memory is insufficient for the repository size and workload.
- Note: Don’t prescribe a fixed
-Xmxvalue or a specific garbage collector without environment-specific memory analysis and performance testing. - For additional guidance, see How to analyze common critical AEM issues.