double allocation error

51 views
Skip to first unread message

Peter

unread,
Jan 7, 2008, 10:54:41 AM1/7/08
to H2 Database
I'm occasionally getting the double allocation error referenced in a
previous thread [http://groups.google.com/group/h2-database/
browse_thread/thread/e78d85a78adca144/4c9822e4e537bb58?lnk=gst&q=double
+allocation#4c9822e4e537bb58] and in the ChangeLog for Version 1.0.59
(2007-10-03). I'm using the latest 12/27 H2 release modified with your
Script CLOB fix and a fully updated 1.5 Mac OS X java vm in a
development environment.

The error usually happens after I've stopped the vm by hitting the
"Terminate" button within eclipse. I do not believe anything is wrong
with the database data itself because after one (or occasionally) two
connection attempts by the application server (jboss) H2 has always
figured things out again and returned to normal operation.

What I'm not sure about is how to go about helping you find the
problem. I've only been able to get this error while dealing with a
large-ish dataset of ~650MB which prohibits sending along the whole
thing. I saw the TRACE_LEVEL_FILE request in a previous thread so I
recreated the problem with TRACE_LEVEL_FILE=3 and sent that compressed
trace.db file to Thomas in a private email.

I'd be happy to do any other tests or debugging traces that might be
helpful. I could compile additional logging into H2 if necessary.

My db url is: jdbc:h2:~/Documents/h2/db/
staging;CACHE_SIZE=32768;AUTOCOMMIT=OFF;MAX_LENGTH_INPLACE_LOB=16384

Stack:
Caused by: org.h2.jdbc.JdbcSQLException: General error:
java.lang.Error: double allocation [HY000-64]
at org.h2.message.Message.getSQLException(Message.java:89)
at org.h2.message.Message.convert(Message.java:174)
at org.h2.engine.Database.open(Database.java:458)
at org.h2.engine.Database.<init>(Database.java:193)
at org.h2.engine.Engine.openSession(Engine.java:52)
at org.h2.engine.Engine.getSession(Engine.java:100)
at org.h2.engine.Session.createSession(Session.java:143)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:917)
at org.h2.Driver.connect(Driver.java:52)
at
org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:
171)
... 130 more
Caused by: java.lang.Error: double allocation
at org.h2.message.Message.getInternalError(Message.java:126)
at org.h2.store.DiskFile.setPageOwner(DiskFile.java:576)
at org.h2.store.DiskFile.setBlockOwner(DiskFile.java:536)
at org.h2.store.DiskFile.init(DiskFile.java:320)
at org.h2.engine.Database.open(Database.java:450)

Many thanks,
Peter

Peter

unread,
Jan 8, 2008, 2:38:44 PM1/8/08
to H2 Database
Thomas,

"There are unit tests that start a new process and kill it
(Runtime.halt). Could you run the unit tests on your system and post
the results? 'ant test' should work."

I uploaded "h2-2007-12-27_test.zip" with all of the test output. The
tests did not complete normally. I had to kill the process after some
out of memory exceptions. All shell output was redirected to
test.terminal.out which is in the archive and I left the rest of the
files as-is.

"I saw there are some exception "No disk space available [90100-64]",
could the problem be related to that?"

I don't think so. These were leftover from an earlier test I did that
ended up consuming all of my disk as it used the Script tool
repeatedly. It's possible the database never really recovered from
this, but the disk was never 100% out of space so small db writes
should have been able to happen. It was refusing to write a new 700MB
Script output file. And, in the end, I was using the database after
the disk space incident.

"It should be possible to start the database with RECOVER=1. Did you
try that?"

I never had to. A second connection attempt to the database usually
worked.

"I would need a trace.db file from the start of the database
(including "create table" and so on), until it is corrupted. Is that
possible?"

No.. not with the larger dataset I have and I haven't had the problem
even once with a smaller dataset. However I can make my test dataset
larger in an attempt to cause the problem. If it's merely size that
allows the problem to occur I should be able to replicate it with a
clean trace file that I can send you. I'll work on that.

Thank you,
Peter

Thomas Mueller

unread,
Jan 11, 2008, 4:41:34 AM1/11/08
to h2-da...@googlegroups.com
Hi,

I uploaded "h2-2007-12-27_test.zip" with all of the test output. The
tests did not complete normally. I had to kill the process after some
out of memory exceptions. All shell output was redirected to
test.terminal.out which is in the archive and I left the rest of the
files as-is.

Thanks for your help! Something is wrong, but it could be the test as well. I will try to reproduce this on a Mac next week (I don't have one, but I think I can borrow one for testing).

"I saw there are some exception "No disk space available [90100-64]",
could the problem be related to that?"

I don't think so.

OK, good to know.

If it's merely size that
allows the problem to occur I should be able to replicate it with a
clean trace file that I can send you. I'll work on that.

Good to know. Maybe the problem is log file switching. Could you try again with a small log file size? Just append ;MAX_LOG_SIZE=1 to the database URL: jdbc:h2:test;MAX_LOG_SIZE=1

Thanks a lot for your help!
Thomas

Thomas Mueller

unread,
Feb 26, 2008, 1:09:59 PM2/26/08
to h2-da...@googlegroups.com
Hi,

Unfortunately I still didn't have access to a Mac... However I have
fixed many tests on Ubuntu. Also, I have fixed a 'double allocation'
in the database in the latest release. Do you use multiple
connections? Could you run the init tests again please? I only need
the output (system out and system err, no other files). Could you test
your application again and tell me what the results are?

Thanks for your help!

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages