Hashmap is full

35 views
Skip to first unread message

Steve Luo

unread,
Feb 4, 2012, 1:01:14 AM2/4/12
to H2 Database
Hi,

When connect with my h2 database, below exception occurred:

java.lang.RuntimeException: hashmap is full
at org.h2.message.DbException.throwInternalError(DbException.java:
228)
at org.h2.util.IntIntHashMap.put(IntIntHashMap.java:82)
at org.h2.store.PageStore.addMeta(PageStore.java:1574)
at org.h2.store.PageStore.readMetaData(PageStore.java:1535)
at org.h2.store.PageStore.recover(PageStore.java:1329)
at org.h2.store.PageStore.openExisting(PageStore.java:349)
at org.h2.store.PageStore.open(PageStore.java:273)
at org.h2.engine.Database.getPageStore(Database.java:2049)
at org.h2.engine.Database.open(Database.java:553)
at org.h2.engine.Database.openDatabase(Database.java:220)
at org.h2.engine.Database. (Database.java:215)
at org.h2.engine.Engine.openSession(Engine.java:56)
at org.h2.engine.Engine.openSession(Engine.java:159)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:138)
at org.h2.engine.Engine.createSession(Engine.java:121)
at org.h2.engine.Engine.createSession(Engine.java:28)
at
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:
285)
at org.h2.jdbc.JdbcConnection. (JdbcConnection.java:110)
at org.h2.jdbc.JdbcConnection. (JdbcConnection.java:94)
at org.h2.Driver.connect(Driver.java:72)
at java.sql.DriverManager.getConnection(DriverManager.java:316)
at java.sql.DriverManager.getConnection(DriverManager.java:353)
at

I assigned 1G memory to my JVM, and used only 93.89M. Does anybody
know why this occurred and how to deal with it?
Thanks in advance.

Steve Luo

unread,
Feb 4, 2012, 1:03:25 AM2/4/12
to H2 Database
By the way, the version of h2 is 1.3.159

Thomas Mueller

unread,
Feb 4, 2012, 3:29:28 AM2/4/12
to h2-da...@googlegroups.com
Hi,

I don't know what it could be. I wonder if it could be a
multi-threading issue...

Could you send me the database file?

If not, what is your database URL? Do you have a reproducible test case?

Regards,
Thomas

Steve Luo

unread,
Feb 4, 2012, 5:23:04 AM2/4/12
to H2 Database
Hi Thomas,

Thank you very much for the prompt response.

Actually, this issue is raised by my customer and I didn't get the
database either. The database URL looks like below:
jdbc:h2:/home/data/scm_activity.db

I can't reproduce the problem. I wonder if this problem is caused by a
corrupt database? I have received some bug reports from my customer
which were caused by corrupt database (after running h2 recover tool,
the problem dismissed).

I do use multi-thread, some threads will read the data, and some will
write the data. In my case, I use some lock mechanism by myself to
isolate the operation to database. That is, every time multiple
threads can open the database for reading which will block the write
thread, and only one thread can open the database for writing which
will block all other threads. When a thread want to access the
database for read, below url is used:
jdbc:h2:/home/data/scm_activity.db;ACCESS_MODE_DATA=r


So, would you please give some suggestions or direction on this? By
the way, I can't use h2 in server mode as there may be too much data
need be stored.

Best Regards

Steve


On Feb 4, 4:29 pm, Thomas Mueller <thomas.tom.muel...@gmail.com>
wrote:

Thomas Mueller

unread,
Feb 23, 2012, 2:42:37 AM2/23/12
to h2-da...@googlegroups.com
Hi,
 
In my case, I use some lock mechanism by myself to
isolate the operation to database.

I'm sorry but I will not be able to debug the problem then, unless you post this locking mechanism.

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages