ObjectDB ObjectDB

internal object DB locking in an embedded multi threaded application

#1

Hi,

we are using Embeded objectDB 2.4.4_06 in a highly multithreaded concurrent manner and we have noticed a performance problem in our application that seems to be attributed to ObjectDb's internal locking.

When profiling our app in JVisualVm we notice a large number of threads are blocked and when doing a threaddump we notice that they are all blocked in the same place:

java.lang.Thread.State: BLOCKED
   at com.objectdb.o.MST.Vb(MST.java:1293)
   - waiting to lock <3a678c0> (a com.objectdb.o.LKM) owned by "ODB-FileWriter" t@16
   at com.objectdb.o.WRA.Vb(WRA.java:370)
   at com.objectdb.o.WSM.Vb(WSM.java:174)
   at com.objectdb.o.OBM.bL(OBM.java:922)
   at com.objectdb.o.OBM.bJ(OBM.java:827)
   at com.objectdb.o.OBM.bH(OBM.java:733)
   at com.objectdb.jpa.EMImpl.commit(EMImpl.java:276)

"ODB-FileWriter" - Thread t@16
   java.lang.Thread.State: RUNNABLE
   at java.io.RandomAccessFile.setLength(Native Method)
   at com.objectdb.o.LFL.R(LFL.java:996)
   at com.objectdb.o.SFL.ah(SFL.java:998)
   - locked <67fc75bc> (a com.objectdb.o.LFL)
   at com.objectdb.o.MST.ah(MST.java:1746)
   at com.objectdb.o.SFL.ag(SFL.java:958)
   at com.objectdb.o.SFL.run(SFL.java:918)
   - locked <62633b0e> (a com.objectdb.o.PGC)
   - locked <3a678c0> (a com.objectdb.o.LKM)
   at java.lang.Thread.run(Thread.java:662)

   Locked ownable synchronizers:
- None

 this seems to take a considerable lenght of time ( approx 4-10 seconds). do you have any suggestions as to how we can improve / elviate this? our database files are between 100 and 500 meg when this occurs. It doesnt happen all the time but periodically. We do alot of inserts, queries and remove as we use objectdb to drive a persistent queue.

 

Dan

 

edit
delete
#2

The second stack trace (thread t@16) indicates database file resizing.

You may try avoiding file resizing by setting relevant configuration (mainly the initial database size).

ObjectDB Support
edit
delete
#3

If no conf file is found or provided then what are the default values?

edit
delete
#4

The default values are:

  <size initial="256kb" resize="256kb" page="2kb" />
ObjectDB Support
edit
delete
#5
<database>
  <size initial="500mb" resize="500mb" page="2kb" />
  <recovery enabled="true" sync="false" path="." max="128mb" />
  <recording enabled="false" sync="false" path="." mode="write" />
  <locking version-check="true" />
  <processing cache="64mb" max-threads="10" />
  <query-cache results="32mb" programs="500" />
  <extensions drop="temp,tmp" />
</database>

 

this didnt result in 500mb files.  do i need to specify the size in kbs?

edit
delete
#6

The initial size setting should affect only new database files.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.