Solved

Java heap memory error

Posted on 2009-06-28
16
482 Views
Last Modified: 2013-11-24
hi

SEVERE: Caught exception (java.lang.OutOfMemoryError: Java heap space) executing org.apache.jk.common.SocketConnection@1906e61, terminating thread

my web application runs well for full day. when it comes to peak hours its suddenly crashes with java heap memory error and totally hangs.
i use java 1.4, tomcat 5.5, mysql 5.

Once i restart tomcat mean its work fine.
Why this happen in regular. anyone kindly help me to sort out.

My system Memory is 1GB.

Thanks in Advance
0
Comment
Question by:arjunarajan
  • 7
  • 6
16 Comments
 
LVL 11

Expert Comment

by:Manish
ID: 24731108
Please post code which is using socket connection.
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 24733987
>>My system Memory is 1GB.

whats your heap setting?
0
 

Author Comment

by:arjunarajan
ID: 24743447
my heap setting 256MB for JVM.
When at peak hours 150 t0 200 users can access the site and application continously
0
 
LVL 26

Accepted Solution

by:
ksivananth earned 125 total points
ID: 24743686
I think, 256MB is too low for 200 users... try increasing it to 786 and see if you still see the issue. if you still see the issue, you may want to run some profiler if there are any memory leaks!
0
 

Author Comment

by:arjunarajan
ID: 24743707
how to set JVM memory, i dont know as im new to JVM side.
i hope its a JVM problem ly as the application run for past two years it works fine but now the hits is increase only from one month i phase this issue.

i want to know how to set JVM memory in linux and windows. and where i find that value.
kindly guide me
0
 
LVL 26

Assisted Solution

by:ksivananth
ksivananth earned 125 total points
ID: 24743714
0
 

Author Comment

by:arjunarajan
ID: 24743732
thats ok to set.. how i know before value that JVM uses...
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 26

Expert Comment

by:ksivananth
ID: 24743793
>>how i know before value that JVM uses...

you have told 256MB is set already!
0
 

Author Comment

by:arjunarajan
ID: 24743822
ya that my server maintain people said.... i want to check mean.. any commands r any other tool identify that ya....
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 24743978
check the catalina.sh/bat file, they should have configured the heap settings there!

also checo if there are any env variable JAVA_OPTS defined that has heap settings!
0
 

Author Comment

by:arjunarajan
ID: 24751654
i checked u said files i didn't find anything like that .
we have a dedicated linux server. i want to cross check whether they set java heap memory or not. say where i can see that value.
0
 

Author Comment

by:arjunarajan
ID: 24833647
I finally fixed the problem by increasing the system memory.
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 24837509
increasing the system memory can not fix the issue, no matter how much memory your system has but JVM can use only what allocated for it. the only way to increase the memory for JVM is through the env variables like -Xms, -Xmx which I have asked him to do so earlier!
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 24846626
I recommend the below commentids to be accepted as answer,

ID:24743686
ID:24743714
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
json format text only 4 75
where is session ID cache stored 1 46
looking for unix program to search some keywords in side EAR WAR and JAR files 10 80
jar file executable 12 38
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now