0

We are using Fedora-8 64 bit in Amazon EC2 and our Java application is running on the IBM JRE. Now we are getting a Java hang "out of memory" error. Our memory is 7.6 GB and we have allotted heap memory -Xms3000M -Xmx3000M. We are still getting the same problem. The question is, if I increase the heap size then will this problem be rectified? Or is there any other alternative to solve this problem?

0

3 Answers 3

2

3G is sound like large enough amount of memory assigned to java heap, you may get not heap out of memory but permanent generation (PermGen). Consider increase PermSize and MaxPermSize.

To solve problem you may need monitor how fast and which part of JVM memory is growing. Use JMX console, also you may look deeper - take snapshot of running java heap and analyse it to define problematic places (http://www.eclipse.org/mat/) also thread dump and object histogram may help.

1
  • I agree. Increase MaxPermSize to maybe 256M.
    – djangofan
    May 3, 2011 at 19:15
0

Fedora-8 is a four year old release. You should seriously considering upgrading your environment to the latest stable release of your distro and the EC2 kernels before trying to track down any mis-behaving software memory issues.

1
  • Yeah, on EC2, with a Java service running, I would recommend using either the default Amazon Linux distros (similar to Redhat) or the SUSE 9 that is available.
    – djangofan
    May 4, 2011 at 23:48
0

You shouldn't be using a "JRE" version of Java. You should be using a version of Java that supports the -server VM. It could be that since your running a Java that is a JRE, that it has limits on JVM size since its defaulting to a non-server VM. Its easy to investigate this: just looking in your JRE directory for the "server" directory to see if you have it. I don't know anything about the IBM JRE though, and so your milage may vary on my advice.

I would recommend trying the latest version of the Oracle JDK instead since I am 100% sure it has a -server implementation in it. Or, maybe a JDK version of the IBM vm, if you can get it.

I say all these things because your question states that your explicitly using a JRE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.