Aborted transactions not being cleared causing memory leak resulting in OutOfMemoryError: PermGen/Metaspace
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
-------------------------------------------------------------------------------------------------------------------------------------------------
Environment
- JBoss Enterprise Application Platform (EAP)
- Versant DB driver packaged as a module (not in the
ear).
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
