-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: OutOfMemoryError when Lazyloading is on in a normal java app
PostPosted: Wed May 31, 2006 9:22 am 
Newbie

Joined: Wed May 31, 2006 8:58 am
Posts: 6
Location: Netherlands
Hi I have a burning question regarding OutOfMemoryErrors when turning LazyLoading on. When lazyloading is off, everything runs ok. So i reckon it must have something to do with this CGLIB stuff

I have searched through this whole forum for a solution and have tried the things suggested (see below) but to no avail.

I've built a code generator that generates hibernate POJOS and the mappings from reading the db metadata.

this generator created a total of 1400 entities from 2 databases, with no collections. which are all correct.

these entities are then used as a db layer for a data replication tool i'm building. it copies data from one db to another (with some transformation of data)

but i keep getting OutOfMemoryErrors.

i've tried these things:

setting hibernate.cglib.use_reflection_optimizer to false in the system properties, but when debugging i can still see the CGLIBenhanced classes on some many-to-one properties

I serialized the ConfigurationObject

I call session.clear() on each commit

I call session.flush() on each commit

Instrumenting the classes just made things worst, it couldn't get past the cfg.buildSessionFactory()

Setting the heap size to 1024 doesn't work (when looking at (VM)Memory in my taskmanager, it doesn't get near 1024 before throwing this outofMemoryError). the tool dies when 390 MB is reached

Nothing i did above had any effect.

the only thing that worked, was turning lazyloading off, but that generated a monster sql statement for entities with lots of outgoing references

I'm not using Tomcat or anything, I've implemented a workmanager api to run the tool concurrently. So no (re)deployment is needed.

So what else can i do?

Please any help would be appreciated


Hibernate version: 3.1.3


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 9:57 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
try -XX:MaxPermSize=128m


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 11:25 am 
Newbie

Joined: Wed May 31, 2006 8:58 am
Posts: 6
Location: Netherlands
Wooha, that really fixed the problem :)
i have no idea what that setting means, but thanks anyways


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.