-->
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: OutOfMemoryException with hibernate 3.0.2. and MS SQL Server
PostPosted: Thu Nov 16, 2006 12:22 pm 
Newbie

Joined: Thu Nov 16, 2006 11:52 am
Posts: 8
Location: Frankfurt a.M., Germany
Hibernate version:3.0.2

Hello,

I get an OutOfMemoryException in the following block:

Session session = sessionFactory.openSession();
List models = (List) session.createCriteria(MyModel.class).list();
session.close();
sessionFactory.evict(MyModel.class);

At first sight the problem seems very obvious, but matters are behind the scenes more complicated:

Firstly, the query above (only executed for testing purposes) only return some 1500 records which should not cause memory to run full.

Secondly, the problem exists only when connected with the test database but not when connected with the dev database. Both databases are identical (created with the same SQL create table statements). After I regenerate the test database (drop table, then create table) the problem disappears. After a while it pops up to the surface again. We use MS SQL Server 2000 with Microsoft's latest sqljdbc.jar.

Does somebody have an idea where to start searching for the cause of the problem? We haven't gone into production and I would like to have tracked this down before we do so.

Thanks and regards,
Oliver


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 4:51 pm 
Beginner
Beginner

Joined: Fri Apr 15, 2005 3:30 pm
Posts: 46
Location: Fortaleza, Brazil
Something else maybe taking your memory, perhaps not hibernate. Turn logging on via log4j DEBUG etc and see if you can find something suspicious around the out of memory error. Try looking at your processor monitor to see if something else is pegging your machine.


Top
 Profile  
 
 Post subject: Reply
PostPosted: Thu Nov 16, 2006 5:03 pm 
Beginner
Beginner

Joined: Mon Aug 22, 2005 9:57 pm
Posts: 27
Hey

How do you know OutOfMemory happend on that code block?

since it is errror which doesnot provides stacktrace.

you may set breakpoint at OutOfMemory's constructor and find where is the origin
of OutOfMemory ..


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.