Aborted transactions not being cleared causing memory leak resulting in OutOfMemoryError: PermGen/Metaspace
Environment
- JBoss Enterprise Application Platform (EAP)
- Versant DB driver packaged as a module (not in the
ear).
Issue
- A heap dump is being generated (as a result of the
-XX:+HeapDumpOnOutOfMemoryErrorJVM option) after running out of PermGen/Metaspace space (OutOfMemoryError: PermGen spaceorjava.lang.OutOfMemoryError: Metaspace). - Inspection of the heap dump shows a classloader not able to be collected due to references to Versant classes:
----------------------------------------------------------------------------------------------------------------------------------------------------
org.jboss.modules.ModuleClassLoader @ 0x6e7859bf0 | 88 B | 446.57 KB
|- <classloader> class com.example.entity.MyClass @ 0x6da51c6f0| 16 B | 16 B
| |- runtimeClass com.versant.jpa.metadata.ClassMetaDataImpl @ 0x6e690a520 | 184 B | 2.90 KB
| |- clazz com.versant.jpa.core.ObjectFactoryImpl @ 0x6e690f098 | 24 B | 24 B
| | '- factory com.versant.jpa.metadata.ClassMetaDataImpl @ 0x6e690a520 | 184 B | 2.90 KB
| | |- value java.util.HashMap$Entry @ 0x6e690a500 | 32 B | 32 B
| | | '- [6179] java.util.HashMap$Entry[16384] @ 0x6de5d2f50 | 64.02 KB | 271.73 KB
| | | '- table java.util.HashMap @ 0x6de5c2648 | 48 B | 335.84 KB
| | | |- entityName2ClassMetadata com.versant.jpa.core.MetadataController$3 @ 0x6de5c2628 | 32 B | 35.18 MB
-------------------------------------------------------------------------------------------------------------------------------------------------
Resolution
Proposed fix for EAP 6.4.11:
This content is not included.This content is not included.https://bugzilla.redhat.com/show_bug.cgi?id=1387316
Root Cause
-
Local issue with EJB CMT endTranaction()
Content from issues.jboss.org is not included.Content from issues.jboss.org is not included.https://issues.jboss.org/browse/WFLY-6214 -
Remote - Race condition when the imported TX is rolled back by the reaper before the remote reaper
Content from issues.jboss.org is not included.Content from issues.jboss.org is not included.https://issues.jboss.org/browse/JBTM-2774
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.