-->
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.  [ 1 post ] 
Author Message
 Post subject: Simple request : java.lang.OutOfMemoryError: Java heap space
PostPosted: Tue Sep 30, 2008 11:35 am 
Newbie

Joined: Mon Jul 16, 2007 10:44 am
Posts: 15
Hello,
I'm developing a web application using the hibernate framework.

When I realod my managed bean, automatically it execute the constructor of this bean. In this constructor I need to get data from database. so I make call on it. The table contains about 8000 items.

When I reload many times my bean, I have this exception :

Code:
java.lang.OutOfMemoryError: Java heap space
   at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
   at java.lang.AbstractStringBuilder.append(Unknown Source)
   at java.lang.StringBuffer.append(Unknown Source)
   at org.apache.naming.resources.FileDirContext.normalize(FileDirContext.java:780)
   at org.apache.naming.resources.FileDirContext.file(FileDirContext.java:857)
   at org.apache.naming.resources.FileDirContext.getAttributes(FileDirContext.java:434)
   at org.apache.naming.resources.BaseDirContext.getAttributes(BaseDirContext.java:725)
   at org.apache.naming.resources.ProxyDirContext.getAttributes(ProxyDirContext.java:835)
   at org.apache.catalina.loader.WebappClassLoader.modified(WebappClassLoader.java:722)
   at org.apache.catalina.loader.WebappLoader.modified(WebappLoader.java:506)
   at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:427)
   at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1278)
   at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
   at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
   at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
   at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
   at java.lang.Thread.run(Unknown Source)


This is the request
Code:
session.createQuery("from Tblorder where order_brokerid = '" + str+ "' order by (order_id)").list();




It gets 8000 items. In every relaod I called this request 3 times (for certain reason). In the third call the exception appear.

Note that in the second call the execution time of the request is 4938ms which is I think very strong for just 8000 items !!!

thanks for your help

Platform : Windows XP / Eclipse WTP 3.2/ Tomcat / Postgres 8.3


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.