0

We are getting frequent out of memory errors in our dev. machines We are running webshpere, eclipse, soap UI and maven in it. Our server gets down due to this "out of memory errors" when we restart our applications in websphere 2/3 times, We already increased the virtual memory setting in wesphere to 1GB.

So what i did was copied the jre we use in eclipse and maven folders so that each of these uses individual jvms. But the performance of websphere is same. 2/3 restarts and out of memory errors.

Is there any may of making eclipse and maven use different jvms other than websphere's?

9
  • 3
    How much physical memory does a machine have, how much memory the different VMs are allocated? Mar 18, 2010 at 7:28
  • Does it make any difference if you run four times the same JVM binaries, or four different binaries? I would hope not.
    – Thilo
    Mar 18, 2010 at 7:38
  • Well, if for example the sum of -Xms on all VMs exceeds the physical memory on the box, you are guaranteed an OutOfMemory exception Mar 18, 2010 at 7:41
  • @David Soroko. But that would happen in both cases, no?
    – Thilo
    Mar 18, 2010 at 8:10
  • How to calculate sum of -Xms on all VMs David?
    – Rajesh
    Mar 18, 2010 at 8:37

3 Answers 3

4

In response to the question:

If you start java multiple times, multiple copies of java will be running with each their own memory. Eclipse and websphere are probably started separately so use independent memory. Your trouble should not be there.

In response to your problem

Out of Memory

Both Eclipse and Websphere can gobble up memory like there's not tomorrow. Look al the -X flags, the flag for perm gen space should be added to the flag for heap space to get the memory consumption. Also allow some overhead for the OS, windowing environment, e-mail client, browser (500 MB - 1 GB or so, depending on the OS and what you're running). So it can be that the computer is out of memory.

More frequently the amount of memory assigned to the jvm is just not enough. Java has not been started with enough memory for the app assigned to it. It's up to you to deduce if it is Heap Space which ran out, or PermGen space. Both can be adjusted, have a look at this website. The flags are -Xmx and -XX:MaxPermSize. Look at the start scripts for Websphere, as that's the one complaining.

Recommendation

Check which kind of memory is out, and search for that on stack overflow; either PermGen or Heap Space should do.

2
  • The system has 4GB of memory. 1 GB is allocated to websphere itself.
    – Rajesh
    Mar 18, 2010 at 8:36
  • @Rajesh is it possible for you to paste (part of) the stack trace in the question? I'm curious as to what error you get. Assigning max heap space (-Xmx) has no relation to the permgen space (-XX:MaxPermSize), so it's important to focus on the real one. That said, memory use of an app is Heap Space + Permgen, so actual memory use may be higher. Reloading of an app may result in heap space pollution as not all loaded classes may be unloaded, that would point to permgen space trouble.
    – extraneon
    Mar 18, 2010 at 8:49
0

You should set the JVM Xmx parameter less than or equal to 256MB in all the three process. It will never cross the 256 MB limit (considering that the program does not have memory leaks)

1
  • You might have different applications in the same JVM, or use a heavy framework, for example grails, just one grails app will need more than Xmx256m Oct 4, 2014 at 19:31
-1

Copying the folder won't be enough.

In Eclipse, go to Preferences, under Java-> Installed JREs make sure the JRE used is on a different path than the one used by WebSphere.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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