-->
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.  [ 2 posts ] 
Author Message
 Post subject: Deep Union-sub inheritance consumes lots-o heap space>768
PostPosted: Wed Jul 30, 2008 6:16 pm 
Newbie

Joined: Sun Mar 25, 2007 7:28 pm
Posts: 2
Hi All,

I'm using Oracle 10g and Hibernate Core 3.2.6 on a complex app with quite a few classes (~90 at present, with 13 abstract classes [most near tree top], and ~200 classes planned). (The hibernate version used does not affect the memory usage.)

I switched to union-sub from table per class at around 30 classes and had to increase the heap space to 385. With the present configuration the heap must be greater than 768mb just to build the session factory. I had to pare down the set of entities in order to profile, but I confirmed that the space is not gc'd after factory creation. The vast majority of the space directly after factory creation was taken up by char[] elements (>90%).

I'm just wondering if this is a design flaw on my part (is union-subclass not meant / allowed to be 'deep') or if this is an issue with Hibernate itself.

With every new set of class additions the factory seems to grow by 10s of mb. I've had to increased heap space to 1g in order to cope with this issue (>768 to make the factory, plus space for usage), but I'm guessing this is not the way it was meant to operate!

I'm in the process of trying to debug this and / or create a set of hibernate objects to illustrate it and post a bug, but was just wondering....

Has anyone else run into this?

Thanks,
-Mike


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 31, 2008 4:30 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
I think you're really just running into some real issues that you get with mapping an object oriented system into a relational database. It gets tough. The fact that there are three different mechanisms for mapping inheritance just demonstrates that there is no, single, right answer for mapping inheritance, just wrong answers, with some wrong answers being less wrong than others, given a certain scenario.

Mapping Inheritance in Hibernate Tutorial: Benefits and Drawbacks

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.