Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to solve java.lang.OutOfMemoryError.

Status
Not open for further replies.

chags

Programmer
Dec 4, 2000
12
US
Hi,

Can anyone help me in giving suggestion how to solve java.lang.OutOfMemoryError. very urgent!

Thanks in advance,
chags.
 
Hi,

I had this problem once and I restarted my machine. Try to avoid having to many programs running at the same time. I am not sure. :)

 
Hi Addola,

Thanks for your reply. Same thing i did, its working fine but I need to know axactly why it is coming. We are moving the project to production. At last munite i am facing this problem. I don't want to repeat this once again in production.

Thanks,
Chags.
 
hello,

which context gives you this error message ?

are you running JSP pages in an http server or a client side application ?

manu0
 
Hi Manu,

when i try to submit the data to the servlet,I'm getting OutOfMemoryError at Stringbuffer. The following is the exact message:

java.lang.OutOfMemoryError at java.lang.StringBuffer.append(Compiled Code) at forecast.common.QuotesPageFormatter.formatTable(Compiled Code) at forecast.servlets.SFAGetQuotesServlet.process(Compiled Code) at forecast.servlets.SFAGetQuotesServlet.doPost(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at com.sun.server.ServletState.callService(Compiled Code) at com.sun.server.ServletManager.callServletService(Compiled Code) at com.sun.server.http.servlet.InvokerServlet.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at com.sun.server.ServletState.callService(Compiled Code) at com.sun.server.ServletManager.callServletService(Compiled Code) at com.sun.server.ProcessingState.invokeTargetServlet(Compiled Code) at com.sun.server.http.HttpProcessingState.execute(Compiled Code) at com.sun.server.http.stages.Runner.process(Compiled Code) at com.sun.server.ProcessingSupport.process(Compiled Code) at com.sun.server.Service.process(Compiled Code) at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at com.sun.server.HandlerThread.run(Compiled Code)

Thanks for your interest,
Chags.
 
have you tried to run the program with the [tt]-Xmsn[/tt] option. A possible option can be -Xm48M, then you start with a minimum memory space of 48M.

Perhaps this helps,
Steven.
 
hi

when you are using the 'append' method, are you sure that you are not in an infinite loop ?

it seems stupid but it can happen... :)

manu0
 
hi

sorry, my last thread was stupid,

I have already experienced the same error message, it generally happens when too many session are open with much data in the sessions context of the users (login objects, data objects ...)

As CatWeasel said you can increase the amount of memory available for the servlet container.
You can also try to reduce the 'invalidation time' for the sessions (time after wich a session expires, and also all objects contained inside). by default I have 30 minutes

manu0

 
Hi CatWeasel,

Could you please alaborate your message "run the program with the -Xmsn option". Whether i have to compile my servlet with -Xmsn or how i have to run. The above error message is related to a servlet. when i an running my application, now and then i am getting outofmemoryerror exception. so could you please send in detail.

Thanks for your reply,
Chags
 
Hi manu,

Hi manu i already set session validation as 30min. I think CatWeasel reply seens to give some good result. Let hear from him a detail reply.

chags
 
Hi
CatWeasel, could you tell me how do you set up the -Xmsn option ? We are using servlets and not an application.

Thanks

 
I'm using weblogic locally to test my servlets before i deploy them. Weblogic (fortunately) is also a Java-application which i execute with the -Xmsn option to increase the initial memory usage (This also includes the memory usage for the servlets).
The only sugestion that i can give you is to check the documentation if it's capable of increasing the initial memory usage.
Hope this helps,
Steven.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top