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