-->
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.  [ 7 posts ] 
Author Message
 Post subject: My memory ,,, Hibernate the Cause...
PostPosted: Wed Mar 19, 2008 2:17 am 
Newbie

Joined: Wed Mar 19, 2008 2:13 am
Posts: 5
what's the matter with ur hibernate team?

why my project run in WAS 6.0 offten out of memory, all the programming way is just copy form ur expensive hibernate book!!!

the memory just growing when any page is runing...

made people out of mind....


Top
 Profile  
 
 Post subject: Re: My memory ,,, Hibernate the Cause...
PostPosted: Wed Mar 19, 2008 11:23 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
how much memory do you give to WAS and how much do you think your application needs? Do you see OutOfMemoryException or you just observe excessive memory allocation?



Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 20, 2008 10:02 pm 
Newbie

Joined: Wed Mar 19, 2008 2:13 am
Posts: 5
I gave the was 1GB ,The Application should wast so many memory,it should be half of them at most!

When i executed the application ,the memory just speed up ,without any idea to drop down!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 20, 2008 10:40 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
twain007 wrote:
I gave the was 1GB ,The Application should wast so many memory,it should be half of them at most!

When i executed the application ,the memory just speed up ,without any idea to drop down!



Read more about IBM JDK's memory management and garbage collector. It's a long story but the hansel and gretel version of it is that it doesn't matter how much memory your application needs, JDK keeps allocating memory since it is easier to allocate memory as compared to fragmenting memory and freeing some space in that way. What you need to do is to turn on VerboseGC on your application and look at memory consumption with a tool like Tivoli and see how much memory your application actually needs. Then you will need to set your JVM maximum heap size to that. In addition, you might want to instruct JVM to keep a maximum free memory which means whenever it frees some memory it also shrinks its allocated memory to ensure a certain maximum percentage and not more than that. In any events, it is true hibernate creates lots of objects, and believe it or not jdbc drivers are even worst than hibernate, but I am not aware of any memory leak from Hibernate code. Ah, in addition do not set your minimum heap memory to anything high. That's a common mistake.



Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 21, 2008 1:13 am 
Newbie

Joined: Wed Mar 19, 2008 2:13 am
Posts: 5
Thanks any way!

I use struts + spring + hibernate +dwr in my application;


Memory just top and top ,

can u tell me such configuration is right?


<bean id="datasource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@172.16.3.152:1521:orcl</value>
</property>
<property name="username">
<value>bras</value>
</property>
<property name="password">
<value>bras</value>
</property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="datasource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
<!-- org.hibernate.dialect.SQLServerDialect-->
<!-- org.hibernate.dialect.OracleDialect-->
org.hibernate.dialect.OracleDialect
</prop>
<prop key="hibernate.show_sql"> true </prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>
com/sunyard/bdfg/model/ExhibitSetting.hbm.xml
</value>
....

<bean id="SmOrganTsbDAO"
class="com.sunyard.bdfg.dao.SmOrganTbDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
...




without any transaction poxiy setting!
Can u give me any idea?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 22, 2008 1:57 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
I can't see anything wrong in the config file. You do need to look at your memory allocation logs to find out how much memory is good for your application. As I said before, it is ok if the app is using all its memory. It's your responsibility to give it as much as it needs.



Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 23, 2008 9:36 am 
Newbie

Joined: Wed Mar 19, 2008 2:13 am
Posts: 5
Thanks !

I think is not the problem of the hibernate ,some times the app is not very stable!


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