-->
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: High memory usage
PostPosted: Wed Jul 13, 2011 1:45 pm 
Newbie

Joined: Wed Jul 13, 2011 1:27 pm
Posts: 2
Hi,
We are using HIbernate 3.3.2 provided JPA 1.0 in our application along with JBPM 4.x and spring 3.x.
The integration is working quite fine but only concern is the high CPU usage.

When we took the heap dumps we noticed the following objects to be taking maximum amount of memory.
1) org/hibernate/ejb/EntityManagerFactoryImpl --> total size 607 MB
2) org/hibernate/imp/SessionFactoryImpl --> total size 607 MB
3) org/hibernate/persister/collection/OneToManyPersister --> total size 19 MB.
4) org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean

We also noticed that when we did JBPM integration we started facing this issue.
Below are the configuration settings which we did for JBPM in spring configuration file.

- <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
- <property name="mappingResources">
- <list>
<value>jbpm.repository.hbm.xml</value>
<value>jbpm.execution.hbm.xml</value>
<value>jbpm.history.hbm.xml</value>
<value>jbpm.task.hbm.xml</value>
<value>jbpm.identity.hbm.xml</value>
</list>
</property>
- <!--

Hibernate properties needed to configure the session factory to use JTA.
This will ensure that jBPM can participate in the application's JTA transactions.


-->
- <property name="hibernateProperties">
- <props>
<prop key="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereTransactionManagerLookup</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.connection.datasource">java:jdbc/naps_dataSource1.1</prop>
<prop key="jta.UserTransaction">java:comp/UserTransaction</prop>
<prop key="hibernate.hbm2ddl.auto">false</prop>
</props>
</property>
</bean>

our persistence.xml file entires are like this
------------------------------------------
<persistence-unit name="NAPS_JPA" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>

<!-- HIBERNATE properties
-->
- <properties>
- <!-- Hibernate Configuration Properties
-->
<property name="hibernate.archive.autodetection" value="class, hbm" />

-->
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />

-->
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.use_sql_comments" value="true" />
<property name="hibernate.default_batch_fetch_size" value="25" />
<property name="hibernate.order_updates" value="true" />
<property name="hibernate.generate_statistics" value="true" />
- <!-- Hibernate Transaction Properties
-->
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.CMTTransactionFactory" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereTransactionManagerLookup" />
<property name="hibernate.transaction.auto_close_session" value="false" />
<property name="hibernate.transaction.flush_before_completion" value="false" />
<property name="hibernate.current_session_context_class" value="org.hibernate.context.JTASessionContext" />
<property name="jta.UserTransaction" value="java:comp/UserTransaction" />
<property name="databasePlatform" value="org.hibernate.dialect.SQLServerDialect" />
- <!-- Hibernate Cache Properties
-->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider" />
<property name="hibernate.cache.use_query_cache" value="false" />
<property name="hibernate.cache.use_second_level_cache" value="false" />

Can you please let us know what is causing so much memory hike.
Actually this is happening during EAR deployment only.


Top
 Profile  
 
 Post subject: Re: High memory usage
PostPosted: Mon Jul 18, 2011 2:21 am 
Newbie

Joined: Wed Jul 13, 2011 1:27 pm
Posts: 2
Can anyone provide any pointers on this?


Top
 Profile  
 
 Post subject: Re: High memory usage
PostPosted: Mon Jul 18, 2011 11:18 am 
Regular
Regular

Joined: Thu May 07, 2009 5:56 am
Posts: 94
Location: Toulouse, France
maybe this can help u: viewtopic.php?f=1&t=981076
I think your hibernate.default_batch_fetch_size property is too great. Hibernate holds in memory a lot of SQL string (one for each access mode) and combined with default_batch_fetch_size it takes a plenty of memory!

_________________
everything should be made as simple as possible, but not simpler (AE)


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.