tags:

views:

430

answers:

3

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?

A: 

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.

medopal
I already did that for eclipse.
Rajesh
+2  A: 

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.

extraneon
The system has 4GB of memory. 1 GB is allocated to websphere itself.
Rajesh
@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
+1  A: 

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)

Neeraj