Hi,

Yes, this is the background thread trying to compact (garbage collect) the
database file. It should only occur if there is no other write activity,
and should not affect write performance.

Regards,
Thomas



On Tuesday, February 28, 2017, andreas fw <andr...@wehowsky.dk> wrote:

> Hi,
>
> I am having an issue, which may be related to the post by Stephen 3/12/14
> titled "High processor usage when no transactions taking place".
>
> I have a Linux box that has been running fine for 3 weeks with a Java app
> that uses an embedded H2 file database. Suddenly at 3am without any real
> activity within a minute the average CPU load went from 8% to 25-30%, where
> a single Java thread "MVStore background writer" takes up 100% when no
> reads or writes are taking place. Some details about the system:
>
>     1 proc box with 1 SSD
>     1 Java app with an embedded H2 file database (1.4.192). The size of
> the db file is ~500 MB.
>     The usage profile:
>         Writes 10-100 rows every minute and few random smaller reads (only
> a few users connected)
>     The Java app connection parameter:
>         jdbc:h2:file:/mnt/data/x/x-db
>         (i.e. no special H2 config)
>     Hardware
>          1 x Intel Celeron 1900 quad core
>     OS
>       Ubuntu 16.04 Server edition
>       Linux kernel 4.4.64
>
>
> Running jstack and jvmtop showed that 100% of a thread is spent in the
> MVStore :
>
> org.h2.store.fs.FileNio.read(FilePathNio.java:74)
>
>
> (no other threads are taking up time or have to do with H2)
>
> "MVStore background writer nio:/mnt/data/x/x-db.mv.db" #104 daemon prio=5 
> os_prio=0 tid=0x00007ff09c299000 nid=0x7208 runnable [0x00007ff0832f3000]
>    java.lang.Thread.State: RUNNABLE
>         at sun.nio.ch.NativeThread.current(Native Method)
>         at sun.nio.ch.NativeThreadSet.add(NativeThreadSet.java:46)
>         at sun.nio.ch.FileChannelImpl.readInternal(FileChannelImpl.java:737)
>         at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:727)
>         at org.h2.store.fs.FileNio.read(FilePathNio.java:74)
>         at 
> org.h2.mvstore.cache.FilePathCache$FileCache.read(FilePathCache.java:87)
>         at org.h2.mvstore.DataUtils.readFully(DataUtils.java:429)
>         at org.h2.mvstore.FileStore.readFully(FileStore.java:98)
>         at org.h2.mvstore.Page.read(Page.java:190)
>         at org.h2.mvstore.MVStore.readPage(MVStore.java:1944)
>         at org.h2.mvstore.MVMap.readPage(MVMap.java:736)
>         at org.h2.mvstore.Page.getChildPage(Page.java:217)
>         at org.h2.mvstore.MVMap.rewrite(MVMap.java:823)
>         at org.h2.mvstore.MVMap.rewrite(MVMap.java:823)
>         at org.h2.mvstore.MVMap.rewrite(MVMap.java:823)
>         at org.h2.mvstore.MVMap.rewrite(MVMap.java:823)
>         at org.h2.mvstore.MVMap.rewrite(MVMap.java:782)
>         at org.h2.mvstore.MVStore.compactRewrite(MVStore.java:1910)
>         at org.h2.mvstore.MVStore.compact(MVStore.java:1802)
>         - locked <0x0000000087734c88> (a java.lang.Object)
>         at org.h2.mvstore.MVStore.writeInBackground(MVStore.java:2504)
>
>
> This couldn't be normal, I think..? Does this have to do with the MVStore
> compaction?
> Thanks in advance for your assistance!
>
> Kind Regards
>
> Andreas W
>
> --
> 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 h2-database+unsubscr...@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to h2-database@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database@googlegroups.com');>.
> Visit this group at https://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
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