We have a memory leak in our application which seems to be related with ObjectDB.
Basically, we use single instance of EntityManager, which is opened on aplication initialization and closed when the user logs out, as well as EntityManagerFactory. We use em.clear() after every commit and after execution of query. Our classes are enhanced with ObjectDB enhancer.
However, used memory is growing overtime until OutOfMemoryException is thrown on JBoss server.
We use JBoss 7.1.1. and latest ObjectDB version.
We took Heap dump and MemoryAnalyzer Tool tells that the 17 instances of class com.objectdb.jpa.emf took about 38%, and 9 instances of 9 instances of com.objectdb.o.TYM took about 11% of memory, even after performing GC from the JVisualVM (screenshots in the attachment).
Heap dump was taken when the server was idle, so no instances of application was beeing runned.
Our suspect is that nothing from the EntityManager was released to the GC, even after em.close(), and emf.close() were called. Is this correct?
Can you please give your opinion in this?