Link to home
Start Free TrialLog in
Avatar of Sathish David  Kumar N
Sathish David Kumar NFlag for India

asked on

Exception in thread "http-80-Processor187" java.lang.OutOfMemoryError: Java heap space

Hi ,

What is this error how to recover  this error ?

Exception in thread "http-80-Processor187" java.lang.OutOfMemoryError: Java heap space
Exception in thread "http-80-Processor8" java.lang.OutOfMemoryError: Java heap space

what are all the change i want to made in tomcat and java side ?
ASKER CERTIFIED SOLUTION
Avatar of colr__
colr__

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mick Barry
your running out of (heap) memory
you can increase the heap memory using the -Xmx startup option, thats assuming your application actiually needs more memory and its not a problem in your application causing it to eat up more ram than really needed.
Avatar of colr__
colr__

I agree with you both to a certain extent, but would it not make mor sense to find out why the heap is being exceeded rather than just increasing the heap size? If the site(s) get busier, you're only going to end up having the same problem again anyway unless you deal withthe problem.

Something else I though of was in my own installation I was getting thousands of requests for FAVIVON.ICO. I tracked this down by looking through the access logs for the deployed applications - take a look there and see if you see anything odd. In the end I had to create an empty FAVIVON.ICO which stopped the repeated requests from killing my server (I think it was Yahoo was requesting the file).
In that case, you need to dig the code to find if any memory leakage is happening.
Avatar of Sathish David  Kumar N

ASKER

what are all the change i want to made in tomcat and java side ?
where i want to run this command ?

 java -Xms<initial heap size> -Xmx<maximum heap size>
>>>>>>>Are you using Tomcat 6? Are you using ThreadLocal?

No 5.5 0nly . is i want upgrade ?
Replace <initial heap size> and <maximum heap size> with memory size like (512m and 768m) and run it on command line.
You need to edit the Tomcat startup scripts, or define the options in the CATALINA_OPTS environment variable.  As others have commented, you should determine whether your app actually needs more memory or if you have a memory leak somewhere in your code before you start adding memory.  Otherwise, you may just be pushing the problem off.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>>>>>>>>In that case, you need to dig the code to find if any memory leakage is happening.

This application is running more than 2 months ... so no memory leakage . i have search screen in that search they didnt select any filters and search means it willretrive morethan 80,000 records so it the pblm .


>>>>>>>You need to edit the Tomcat startup scripts, or define the options in the CATALINA_OPTS environment variable.

How to  do that ?
any input ?
You say that there is no memorty leak, but your memory is expanding over 2 months to the point where the server fails, so there must be a meory leak somewhere.

To make the changes to Tomcat to increase the memory, edit the file /tomcat/binstartup.bat and add the following line to the top of the file (remember to substute the values):

SET JAVA_OPTS="-Xms<initial heap size> -Xmx<maximum heap size>"
>>>>>>>>You say that there is no memorty leak, but your memory is expanding over 2 months to the point where the server fails, so there must be a meory leak somewhere.


I am also thing in that way i check the log when the error occur . after the server restart i did same search again it give memory over flow error . so i thing not memeory leaking ....
Definitely sounds like you need the additional memory.  As indicated, edit the Tomcat startup scripts to set the JAVA_OPTS variable (my mistake earlier) and provide the necessary memory settings.
> How to  do that ?

specify it in the setenv script
>>>>>>>>>>>>You need to edit the Tomcat startup scripts, or define the options in the CATALINA_OPTS environment variable.

>>>SET JAVA_OPTS="-Xms<initial heap size> -Xmx<maximum heap size>"

which one i want to do ? java_opts or catalin_opts ?

JAVA_OPTS, since it is java runtime options, not catalina options
JAVA_OPTS
Which file i want to change ?
you can set this through command line instead changing a file.
No you cant - the java executable is called from within the file. You cant add jvm params outwith the java call, there is no means to do so.