-->
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: Out of Memory Error.
PostPosted: Thu Jan 31, 2008 5:44 pm 
Newbie

Joined: Wed Dec 19, 2007 11:04 am
Posts: 10
Hi,

I am implemention my DB using JPA. I have around 20 methods in my DAO class to get/insert/update/delete records from Tables.

Please find my sample implementation below.
**************************************

createEntityManager("dbSettlementReporting");
ArrayList listProcess = new ArrayList();

try {
String sqlProcess = "select processCode, longDesc from ProcessCode";
listProcess = (ArrayList) em.createNativeQuery(sqlProcess, ProcessBean.class).getResultList();
}catch (RuntimeException e) {
e.printStackTrace();
log.error("Fatel Error Occurred - Please contact Administrator"+e.getStackTrace()); // or display error message
return null;
} catch(Exception e) {
e.printStackTrace();
log.error("Error Occurred - Please contact Administrator"+e.getStackTrace()); // or display error message
return null;
}finally {
closeEntityManager();
}


Problem:
*******

When i run application it was fine for sometime. When i start doing multiple transaction it throw "Out of Memory Error" in the server.

Please find the Error Message below.
******************************
Quote:
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.OutOfMemoryError: PermGen space
Caused by:
java.lang.OutOfMemoryError: PermGen space
2008-01-31 15:00:37,576 TRACE [org.jboss.web.tomcat.security.RunAsListener] AdjustmentClient, runAs: null
2008-01-31 15:00:37,576 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/ADJClient].[AdjustmentClient]] Servlet.service() for servlet AdjustmentClient threw exception
java.lang.OutOfMemoryError: PermGen space.



I am closing both emf and em in finally block of every method.
But i am not closing the transaction which i have used in some of the methods.

Do we really need to close emf and em after every method?

DB : SQL Server
WebServer : JBoss 4.2.2
Framework : Spring.

Kindly help me.

Thanks,
Lakshmi Narayanan.


Top
 Profile  
 
 Post subject: Re: Out of Memory Error.
PostPosted: Thu Jan 31, 2008 9:29 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
Increase the permanent generation heap size by specifying -XX:MaxPermSize.



Farzad-


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.