>
>
>  
Update on this issue!

I still see the issue, and after a little bit of digging I used VisulaVM to 
check in more detail what was eating time!
Here are the screen shoot, which points 
to: removeDuplicateChunkReferences(Page.java:1094)

<https://lh3.googleusercontent.com/-JjpwRDlPw-w/V2qC9vm0TEI/AAAAAAAAAZI/4DiEi-rbA1cs1qRyq0_sExdOwA_K2aoBACLcB/s1600/Capture.PNG>

My guess is that, it does some "cleanup" at the same time as it does commit 
(which for me seems like a "bad" idea)
Any cleanups, should be done in some "post" step of commit, which do not 
block others (if it blocks, it needs to do the blocking in *short* periods)

Another observation is that the thread "MVStore background writer 
nio:C:/Users/gosc...", seems to do some of the cleanup work... 
but while that thread works it *blocks* the thread(s) that tries to insert 
records into the database (so if that thread is supposed to be a 
"maintenance background" task, it doesn't do a good work, since it blocks 
others from working...

BTW: This only happens when the database becomes big, my current db size is 
about 65 GB
And with *long* commit times I mean: currently I add approx 16000 records 
in 15-20 sequential transactions, which takes approx 5-20 minutes (yes 
*minutes* not seconds)

Does anybody have any feedback on this?

/Goran Schwarz
PS. below is a full stack trace of one of the threads trying to commit 
records in the database

Name: PersistentCounterHandler
State: RUNNABLE
Total blocked: 42 256  Total waited: 5

Stack trace: 
org.h2.mvstore.Page$PageChildren.removeDuplicateChunkReferences(Page.java:1094)
org.h2.mvstore.MVStore.readPageChunkReferences(MVStore.java:1384)
org.h2.mvstore.MVStore.collectReferencedChunks(MVStore.java:1327)
org.h2.mvstore.MVStore.collectReferencedChunks(MVStore.java:1332)
org.h2.mvstore.MVStore.collectReferencedChunks(MVStore.java:1312)
org.h2.mvstore.MVStore.freeUnusedChunks(MVStore.java:1271)
   - locked org.h2.mvstore.MVStore@39ab2b4d
org.h2.mvstore.MVStore.storeNowTry(MVStore.java:1060)
org.h2.mvstore.MVStore.storeNow(MVStore.java:1048)
org.h2.mvstore.MVStore.commitAndSave(MVStore.java:1037)
   - locked org.h2.mvstore.MVStore@39ab2b4d
org.h2.mvstore.MVStore.beforeWrite(MVStore.java:2210)
org.h2.mvstore.MVMap.beforeWrite(MVMap.java:1046)
org.h2.mvstore.MVMap.put(MVMap.java:117)
   - locked org.h2.mvstore.MVMap@74169c07
org.h2.store.LobStorageMap.copyLob(LobStorageMap.java:267)
org.h2.value.ValueLobDb.copy(ValueLobDb.java:238)
org.h2.value.ValueLobDb.copy(ValueLobDb.java:248)
org.h2.mvstore.db.MVPrimaryIndex.add(MVPrimaryIndex.java:120)
org.h2.mvstore.db.MVTable.addRow(MVTable.java:704)
org.h2.command.dml.Insert.insertRows(Insert.java:156)
org.h2.command.dml.Insert.update(Insert.java:114)
org.h2.command.CommandContainer.update(CommandContainer.java:98)
org.h2.command.Command.executeUpdate(Command.java:258)
   - locked org.h2.engine.Database@379a5c6d
org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:160)
   - locked org.h2.engine.Session@1eff99f9
org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1189)
com.asetune.sql.conn.DbxPreparedStatement.executeBatch(DbxPreparedStatement.java:381)
com.asetune.pcs.PersistWriterJdbc.save(PersistWriterJdbc.java:2506)
com.asetune.pcs.PersistWriterJdbc.saveCounterData(PersistWriterJdbc.java:2177)
com.asetune.pcs.PersistWriterJdbc.saveSample(PersistWriterJdbc.java:1990)
com.asetune.pcs.PersistentCounterHandler.consume(PersistentCounterHandler.java:1237)
com.asetune.pcs.PersistentCounterHandler.run(PersistentCounterHandler.java:1490)
java.lang.Thread.run(Thread.java:745)


-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to