views:

33

answers:

1
+1  Q: 

Memory in Eclipse

I'm getting the java.lang.OutOfMemoryError exception in Eclipse. I know that Eclipse by default uses heap size of 256M. I'm trying to increase it but nothing happens.

For example: eclipse -vmargs -Xmx16g -XX:PermSize=2g -XX:MaxPermSize=2g

I also tried different settings, using only the -Xmx option, using different cases of g, G, m, M, different memory sizes, but nothing helps. Tried also to specify the values in the eclipse.ini file. Does not matter which params I specify, the heap exception is thrown at the same time, so I assume there's something I'm doing wrong that Eclipse ignores the -Xmx parameter. I'm using a 32GB RAM machine and trying to execute something very simple such as:

double[][] a = new double[15000][15000];

It only works when I reduce the array size to something around 10000 on 10000.

I'm working on Linux and using the top command I can see how much memory the Java process is consuming; it's less than 2%.

Thanks!

A: 

Okay, I found a solution after reading http://stackoverflow.com/questions/681133/eclipse-outofmemoryerror-heap-space

When I specify the -Xmx inside eclipse by going to run->configuration->vm arguments and set the -Xmx there, everything works fine :)