1

I want to know whether i can set -Xmx to 2048M or not.

My system configuration is:

Windows 7, 64bit, 8GB Ram

I am using Eclipse Mars. I am getting GC overhead limit exceeded Heap space issue when -Xmx is 1024M. So i have set -Xmx to 2048M. Now I dont have that problem.I read in some blog that workspace may get crashed with this setting. Is that true?

user1770589
  • 375
  • 1
  • 6
  • 19
  • Possible duplicate of [Increase heap size in Java](http://stackoverflow.com/questions/1565388/increase-heap-size-in-java) – Andy Hoffner Mar 30 '16 at 03:46
  • The Scala IDE, which is based on Eclipse, is configured with -Xmx set to 2048M. That's not an unusual amount of memory to assign to Eclipse. – Marc-André Apr 29 '16 at 02:36

1 Answers1

1

Yes you can do that. Thumb rule is that you can give half of your RAM to JVM if you are not running any other major process. Basically, you need to leave memory for other process running on your operating system. The idea that 2048 will crash workspace came from systems which were available few years back with 3 GB memory generally.

Panther
  • 3,312
  • 9
  • 27
  • 50
  • This solved 90% of my problem, but still sometimes i am getting heap space issue, any other improvements that i can do in configuration? – user1770589 May 04 '16 at 04:10
  • Ideally tuning GC is last option first try to fix any memory leak in your application. However if you still face issues due constraint like you really have very less memory and need to hold lot there. Then you can look other GC parameters like NewRatio , NewSize , ParallelGC . However 99.9999% you should not need it – Panther May 04 '16 at 08:53