H2 on Linux RAM drive (/dev/shm)?

37 views
Skip to first unread message

Ashwin Jayaprakash

unread,
Sep 1, 2011, 2:46:45 PM9/1/11
to h2-da...@googlegroups.com
This is related to running H2 in-memory.

Out of curiosity, has anyone used H2 database disk stored on /dev/shm? This built-in RAM drive (shared memory) is part of the 2.6+ Linux Kernel builds and is available on most Linux distros. This would probably be more scalable in terms of DB size than using the H2 in-memory driver - as the data will be out of the JVM heap but still in the OS memory.

Info on /dev/shm + Java: http://javaforu.blogspot.com/2011/09/ram-disk-is-already-in-linux-and-nobody.html

Ashwin.

Thomas Mueller

unread,
Sep 5, 2011, 2:47:20 PM9/5/11
to h2-database
Hi,

> This would probably be more scalable
> in terms of DB size than using the H2 in-memory driver - as the data will be
> out of the JVM heap but still in the OS memory.

The H2 file format does use less space than the pure in-memory
database. Of course you can use a ramdisk, but I guess it's slower
than the in-memory file systems "memFS:" and "memLZF:" - see also
http://h2database.com/html/advanced.html#file_system

database url: jdbc:h2:memFS:test

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages