Out of Memory Error

#1

Hi Team,

We are observing an Out of Memory error while accessing odb files, but it occurs inconsistently. The sizes of the odb files are not large, with a maximum of 4-5MB. Please see the attached for stack trace from the error logs below and let us know what could be causing this issue.

Thanks,

Vinoth

#2

OutOfMemoryError is expected when the heap size is insufficient.

If you only use small databases, not too many concurrently, and with no other activities that might fill the JVM heap then you should check for a memory leak. This could be caused, for example, if you create EntityManagerFacotry instances but do not close all of them, or still have strong references to entity objects in these EntityManagerFacotry instances.

A heap dump may help in this situations. Please share the main information from the heap dump (when memory is low).

 

ObjectDB Support
#3

Thanks for your update. Please clarify why the objects shown in the screenshot are in the Heap even though the connections are closed properly. We are observing many instances like this and they are residing on heap

Class Name                                   | Shallow Heap | Retained Heap | Percentage
-----------------------------------------------------------------------------------------
com.objectdb.o.MST @ 0x78ad4b678 Busy Monitor|      0.00 MB |       4.39 MB |      0.07%
com.objectdb.o.MST @ 0x77ddbf6f8 Busy Monitor|      0.00 MB |       4.36 MB |      0.07%
com.objectdb.o.MST @ 0x7805ea9c0 Busy Monitor|      0.00 MB |       4.36 MB |      0.07%
com.objectdb.o.MST @ 0x6c037b668 Busy Monitor|      0.00 MB |       4.35 MB |      0.07%
com.objectdb.o.MST @ 0x72249ad10 Busy Monitor|      0.00 MB |       4.26 MB |      0.07%
com.objectdb.o.MST @ 0x71f1bf5d0 Busy Monitor|      0.00 MB |       4.24 MB |      0.07%
com.objectdb.o.MST @ 0x6c58d33a0 Busy Monitor|      0.00 MB |       4.24 MB |      0.07%
com.objectdb.o.MST @ 0x72352a748 Busy Monitor|      0.00 MB |       4.24 MB |      0.07%
com.objectdb.o.MST @ 0x6f89976c8 Busy Monitor|      0.00 MB |       4.23 MB |      0.07%
com.objectdb.o.MST @ 0x7b4594da0 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x775c9f958 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x6aec61e08 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7a594da08 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x79ea0e670 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x720aa8af8 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7a6f97790 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x74b07b4d8 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x6b92dae48 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x783567d30 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x78d3c99c0 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7a0bc9d78 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7a40f8dc0 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x70c5bfb28 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7ac037ec0 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x79b5c0ad8 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7a63b3208 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7b50e1200 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7abeafc40 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7a64f47a8 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x7990848a0 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x776acdb48 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x79a7ca198 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
com.objectdb.o.MST @ 0x65a966168 Busy Monitor|      0.00 MB |       4.22 MB |      0.07%
-----------------------------------------------------------------------------------------
 

#4

Is it embedded mode or the server on a client-server mode?

Possibly EntityManagerFactory instances have bot been closed (note: closing the connections, i.e. the EntityManager instance is insufficient, as an EntityManagerFactory if open keeps a connection pool).

If not, maybe some objects retrieved from the EntityManager are held by the application using strong references and somehow still reference EntityManager instances.

To check this further you can look in the profiler (e.g. VisualVM) for the roots that start the chains of objects that hold these MST objects in the heap.

ObjectDB Support

Reply