user247866
user247866

Reputation: 1511

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!

Upvotes: 3

Views: 3078

Answers (1)

user247866
user247866

Reputation: 1511

Okay, I found a solution after reading Why does heap space run out only when running JUnit tests?

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

Upvotes: 2

Related Questions