memFS

78 views
Skip to first unread message

James Gregurich

unread,
Apr 25, 2010, 12:29:59 AM4/25/10
to h2-da...@googlegroups.com
Question:

When would one want to use "memFS" instead of "mem" for an in-memory db?

-James

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Thomas Mueller

unread,
Apr 27, 2010, 2:30:22 PM4/27/10
to h2-da...@googlegroups.com
Hi,

> When would one want to use "memFS" instead of "mem" for an in-memory db?

memFS is mainly used for testing. It uses the same algorithms as a
regular file system. Probably it needs less memory than mem. memLZF
needs even less memory because it compresses the data (which slows it
down).

See also http://www.h2database.com/html/advanced.html#file_system

Regards,
Thomas

James Gregurich

unread,
Apr 27, 2010, 2:46:23 PM4/27/10
to h2-da...@googlegroups.com
yes. I saw that in the docs. What I'm interested in is your design goals for the feature....what are you trying to accomplish? I'm going to be using an embedded, in-memory db that is concurrently accessed from multiple threads. Ultimately, "which mode should I use?" is the question. What are the costs and benefits to each choice?

-James

Thomas Mueller

unread,
Apr 29, 2010, 2:23:03 PM4/29/10
to h2-da...@googlegroups.com
Hi,

I should add: memFS and memLZF are mainly used for testing the
database engine itself (H2 unit tests). So:

jdbc:h2:mem:x (fastest, uses the most memory)
jdbc:h2:memFS:x (slower, uses a bit less memory)
jdbc:h2:memLZF:x (slowest, uses less memory)

James Gregurich

unread,
Apr 29, 2010, 2:44:08 PM4/29/10
to h2-da...@googlegroups.com
thanks for the info.

one more follow-up:

How concurrency-friendly is each option? suppose you have many threads adding records and many threads reading records to process incoming data. is either of the two options going to be inherently better under that sort of load?

-James

Thomas Mueller

unread,
Apr 30, 2010, 8:56:12 AM4/30/10
to h2-da...@googlegroups.com
Hi,

> one more follow-up:
>
> How concurrency-friendly is each option?

I don't know, you need to try yourself.

James Gregurich

unread,
Apr 30, 2010, 12:02:03 PM4/30/10
to h2-da...@googlegroups.com
ok. thanks.

I'll tinker with it and post my findings.

-James
Reply all
Reply to author
Forward
0 new messages