db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: IJ out of memory
Date Wed, 15 Aug 2007 08:44:51 GMT
Williamson, Nick wrote:
> Thanks Bryan,
> Unfortunately, I'm working with an existing Oracle DDL script which has
> separate FK definitions so I can't easily include them in the table
> definition. I'm just running the Oracle DDL script through a
> reformatting routine that I wrote which removes tokens and statements
> that Derby doesn't like, and running the reformatted version in IJ. 
> Anyway, I've got a solution, albeit not an ideal one. Having done a bit
> more testing, I have found that:
> 1) The main script runs fine if don't create the LOGICPROPERTY table
> 2) Creating the LOGICPROPERTY table in another script, in another
> session, still raises the OOME
> 3) Creating the LOGICPROPERTY table in several small scripts, in another
> session, still raises the OOME
> 4) Creating the LOGICPROPERTY table in several small scripts, running
> each one in a separate IJ session, is successful.
> It's like the definition of LOGICPROPERTY + its 50-odd indexes + its
> 50-odd constraints is just too much for a single IJ session to handle,
> even if I feed it in several chunks. The only solution seems to be to
> create it one step at a time, in separate IJ sessions.
> I'll happily share the script if that would help; at around 650k, I
> think it's too big for the list. If anyone would like to see it, please
> e-mail me off-list.

Hi all,

I asked Nick for the script generating the schema.
With default settings on my machine, I also get the OOME.
A brief investigation revealed a few things:

  1) The OOME occurs during constraint additions (with ALTER TABLE ... 
ADD CONSTRAINT). I could observe this by monitoring the heap usage.

  2) The complete script can be run by increasing the heap size. I tried 
with 256 MB, but the monitoring showed usage peaked at around 150 MB.

  3) The stack traces produced when the OOME occurs varies (as could be 

  4) It is the Derby engine that "produce" the OOME, not ij (i.e. when I 
ran with the network server, the server failed).

I have not had time to examine the heap content, but I do believe there 
is a bug in Derby. It seems some resource is not freed after use.

Filing a Jira issue would be good 
I will do so if the original reporter doesn't. If possible, please 
attach the script to be used as a repro for the bug.


> Regards,
> Nick
> -----Original Message-----
> From: Bryan Pendleton [mailto:bpendleton@amberpoint.com] 
> Sent: 14 August 2007 15:41
> To: Derby Discussion
> Subject: Re: IJ out of memory
>> Failed Statement is: ALTER TABLE logicproperty
>>    ( zone_id )
>>   REFERENCES zone
> You can include the foreign key constraints in the initial table
> definition itself, instead of creating the table and then adding the
> constraints to it later.
> Do you still get the OutOfMemory problem if you include all the foreign
> key constraints in the table definition itself, rather than as separate
> ALTER TABLE statements?
> Also, can you share the entire create_db.sql script?
> thanks,
> bryan

View raw message