• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 897
  • Last Modified:

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 ?
0
Sathish David  Kumar N
Asked:
Sathish David  Kumar N
  • 8
  • 5
  • 4
  • +2
3 Solutions
 
colr__Commented:
What version of tomcat are you using? I was seeing a similar problem for a while on a production tomcat installation that was being caused by Tomcat trying to manage ThreadLocal cleanup. Uprading to the latest version of Tomcat 6 sorted the issue.
Are you using Tomcat 6? Are you using ThreadLocal?
0
 
amitkathpal123Commented:
You need to increase the heap space size.
Here are steps given through command line as well as eclipse:
1) eclipse
 -- open eclipse.ini file directly under eclipse folder.
 -- change/increase values beside -Xms and -Xmx

2) command line
 -- run this command:
  java -Xms<initial heap size> -Xmx<maximum heap size>

more detail for heap space can be find at:

http://java.dzone.com/articles/java-performance-tuning?page=0,1
0
 
objectsCommented:
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.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
colr__Commented:
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).
0
 
amitkathpal123Commented:
In that case, you need to dig the code to find if any memory leakage is happening.
0
 
Sathish David Kumar NAuthor Commented:
what are all the change i want to made in tomcat and java side ?
0
 
Sathish David Kumar NAuthor Commented:
where i want to run this command ?

 java -Xms<initial heap size> -Xmx<maximum heap size>
0
 
Sathish David Kumar NAuthor Commented:
>>>>>>>Are you using Tomcat 6? Are you using ThreadLocal?

No 5.5 0nly . is i want upgrade ?
0
 
amitkathpal123Commented:
Replace <initial heap size> and <maximum heap size> with memory size like (512m and 768m) and run it on command line.
0
 
gordon_vt02Commented:
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.
0
 
gordon_vt02Commented:
And definitely upgrade to at least Tomcat 6.  A lot of performance and security improvements, but it may or may not help your OOME.  On the Java side, it is nearly impossible to recover from an OOME because the system can't clean up the memory so you'd just run into the problem again.  Usually an OOME will terminate the JVM.
0
 
Sathish David Kumar NAuthor Commented:
>>>>>>>>>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 ?
0
 
Sathish David Kumar NAuthor Commented:
any input ?
0
 
colr__Commented:
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>"
0
 
Sathish David Kumar NAuthor Commented:
>>>>>>>>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 ....
0
 
gordon_vt02Commented:
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.
0
 
objectsCommented:
> How to  do that ?

specify it in the setenv script
0
 
Sathish David Kumar NAuthor Commented:
>>>>>>>>>>>>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 ?

0
 
colr__Commented:
JAVA_OPTS, since it is java runtime options, not catalina options
0
 
gordon_vt02Commented:
JAVA_OPTS
0
 
Sathish David Kumar NAuthor Commented:
Which file i want to change ?
0
 
amitkathpal123Commented:
you can set this through command line instead changing a file.
0
 
colr__Commented:
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.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 8
  • 5
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now