-->
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.  [ 10 posts ] 
Author Message
 Post subject: Hardware Requirements To Solve Memory/Performance Issues?
PostPosted: Thu Jan 20, 2005 7:24 pm 
Newbie

Joined: Fri May 14, 2004 6:44 pm
Posts: 9
I was going to ask a post dealing with performance issues, but let me go a different route. What are people running for server hardware. I searched the forums and did not see any similar questions. At work we have a 2 CPU server that has 1G allocated for the JVM. There are 12 applications that are running on that server within the same JVM. About four of those are using Hibernate now.

See, at work we are thinking that we are having memory and performance issues in part because we just do not have enough memory dedicated on the machine to make our applications go. Our mentality is that 1G should be plenty, but now are starting to question that thinking. Since eclusively using Hibernate our memory usage has spiked through the roof and we have started to go back to using JDBC for read only queries instead of HQL. We still use Hibernate to save our data though.

Could our problem be that we simply are not allocating enough memory to take advantage of the level one and level two caching? You know, at some point is everything just caching and no longer just consuming memory. We are very experienced developers, just not experienced administrators and I have no idea what other people use in the real world.

Asking our administrators for more memory is not as easy as it should be so I would like to go in armed knowing that Hibernate users simply demand more hardware.

Also, as a side note...we are currently running Websphere on the JDK1.3. Is there a drastic difference when using the JDK1.4?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 7:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if your memory have *spiked* because of shift from jdbc to hibernate i would claim that you are doing something very wrong ;)...are you using lazy loading properly ?

but besides having 12 server java apps on one machine with 1Gig sounds too me as very small scale ;)

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 8:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if your memory have *spiked* because of shift from jdbc to hibernate i would claim that you are doing something very wrong ;)...are you using lazy loading properly - and how about only querying for what you need ?

but besides having 12 server java apps on one machine with 1Gig sounds too me as very small scale ;)

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 11:19 pm 
Newbie

Joined: Fri May 14, 2004 6:44 pm
Posts: 9
Actually I would just appreciate to know how much memory people allocate for the JVM. I know I cannot really compare apples to apples from one persons site to another, but I think its fair to ask what kind of memory people have allocated. To us it feels like a valid question...is the general concensus that Hibernate needs a lot of memory and they just allocate gigs and gigs of memory? or do people feel that after performance tuning the memory footprint is the same as JDBC and just allocate like 512M and call it good?

I hate to go into the specifics because I know there are a lot of post on performance tuning. But, just as an example we have a query that pulls 15,000 rows from one table. If we use HQL and just ask to do a load the memory spikes drastically. If we fill in a bean with just the data we need it gets better, but is still much more memory intensive than JDBC. The difference would be with HQL it always fills up the first level cache and consumes a lot of memory. With JDBC there is no first level cache and does not. We do have lazy loading turned on and we feel we know Hibernate pretty good at this point. This example is a very easy example and also very easy to profile with JProfiler.

Our sites are not huge by any means, but the data we have to sift through is quite large. Its important to me that I get this right because the company is looking to our group as kind of a test. We are using Spring and Hibernate and if successful then other groups in the company (its a really big place) may move to this technology as well.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 11:30 pm 
Newbie

Joined: Fri May 14, 2004 6:44 pm
Posts: 9
Oh, one last post before I hopefully get some more helpful replys :).

We have no problems with Hibernate's performance, just the memory it consumes. I do not want people to get the two confused. The speed is just fine...the rate that the memory spikes is not. Or, at least if we know at some point it just levels off thats fine too. I would just be surprised to hear people say the memory footprint is low. On the flip side if the memory footprint is high, then how much memory did you throw at it?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 21, 2005 6:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Hi jeffjj,

I can only say that on the projects i've been working on we had the general rule to just have 1GB to each java app.

We of course didn't use that amount when under normal load (much more like 100-200 MB) and when there was silence approx 20-50 MB (on a appserver that doesnt steal resources ;)

The high amount were to handle spikes in load which could occur in the system.

So, that's my "usage" pattern.

Btw. loading 15,000 objects is very doable as long as you use e.g. iterate() together with evict() - then you don't fill up the first level cache (but of course looses some of the identity guarantees, but since you don't have them in the jdbc solution you probably don't care ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 21, 2005 6:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
btw. JDK 1.4 is much better at managing memory and has a much better overall performance too than JDK 1.3 (JDK 1.5 is even better ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 07, 2005 6:56 am 
Newbie

Joined: Thu Mar 11, 2004 6:56 am
Posts: 5
This one might be of interest.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 07, 2005 7:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
......?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 07, 2005 1:45 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
jeffjj wrote:
I hate to go into the specifics because I know there are a lot of post on performance tuning. But, just as an example we have a query that pulls 15,000 rows from one table. If we use HQL and just ask to do a load the memory spikes drastically.

You do not need 15,000 rows for single web page, do you ? There are many workarounds, but server side procedure or view must be the best.


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