April 23, 2020
Estimated Post Reading Time ~

AEM OutOfMemoryError: Java heap space or OutOfMemoryError: GC overhead limit exceeded.

Heap histogram
  • The heap histogram is a simple measurement of the number of live objects and memory used per Java class.
  • To create a heap histogram, you first need the process id of the Java process. To get it, run ps or (if available), run:
jps -l

This Java tool gets the process ids of all running Java processes. Example: 
327 
3332 sun.tools.jps.Jps 
3313 crx-quickstart-....jar

Now run the following command: 
jmap -histo 3313

The list is sorted by total memory required (shallow: excluding referenced objects).
The first 20 lines of the output are the most interesting. Example output:
JVM version is 1.5.0_20-141
Iterating over the heap. This may take a while...
Warning: skipping invalid TLAB for thread t@62211
Warning: skipping invalid TLAB for thread t@62467
...
Size Count Class description
-------------------------------------------------------
10592904 12916 byte[]
10285840 75255 * ConstMethodKlass
6283176 58388 char[]
6042304 14928 int[]
4995752 116201 * SymbolKlass
4220896 75255 * MethodKlass
4196512 6969 * ConstantPoolKlass
2928560 6969 * InstanceKlassKlass
2631008 6066 * ConstantPoolCacheKlass
2395872 149742 org.apache.jackrabbit.core.query.lucene.DocId$PlainDocId
1476008 7003 java.util.HashMap$Entry[]
1396128 58172 java.lang.String
1070232 44593 java.util.HashMap$Entry
753984 10036 short[]
735464 54 org.apache.jackrabbit.core.query.lucene.DocId[]
720192 7502 java.lang.Class
640704 13348 com.day.crx.persistence.tar.index.IndexEntry
...

Additional information
To help to analyze the problem, we also need to know the following information:
  • CRX or CQ version, including a listing of all installed hotfixes version number.
  • Operating system, JVM vendor, and version.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.