-->
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: Processing takes more and more time... Cache/Memory problem?
PostPosted: Mon Mar 10, 2008 10:38 am 
Newbie

Joined: Wed Feb 06, 2008 10:06 am
Posts: 14
Hi there,
I have (again) performance problems on one service methods of my applications.
I retrieve a huge quantity of instances of one entity.
And i process (read from) each entity sequentially (which means as well load the associated entities/associations since i use a lot of lazy loading)
At the beginnin, this works quickly (one instance is treated in 100ms), but after a while, the process takes longer and longer (700 ms)

I don't know what this comes from? Could it be any memory overload / cache overload problem?

Am using Hibernate 3.1.3.


Thanks in advance!!

Nico.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 10, 2008 11:20 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
First record time it takes to load the parent entity, then time it takes to load the associated entity (which are lazy loaded). Get the SQL query from logs and execute it in SQL client for your database. Look for a chance of optimizing the SQL query that Hibernate generates. Then you will get an idea of what to do in HQL or Critieria queries.


Then decide if you can pull only the required results (query pagination).

Finally, it is always better to add the entities to second level cache & query cache.

You can also depend on session statistics to optimize your queries and improve performance.

Thanks


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.