-1

I have read a lot of "increasing Java heap space" questions here in SO and I have yet to understand this question that's bugging me:

If I increase the heap size in either the GUI via > Run > Run Configurations > Arguments > type -Xmx2048m or other size that you want (related); or directly editing the eclipse.ini file (related) with the necessary options, is the value I provided limited by my RAM or can it exceed that?

I only have access to a 2GB machine and I am performing operations on a 150,000-record dataset. I have tried both of the techniques I specified and it still failed.

Note: Specifically I am training the 150K dataset with the WEKA 3.7.10 API in my Eclipse Luna.

Community
  • 1
  • 1
P A S T R Y
  • 351
  • 3
  • 20
  • "_limited by my RAM or can it exceed that?_" How could you ever use more RAM than you have? – takendarkk Feb 08 '14 at 16:51
  • @Takendarkk: by swapping memory to disk. – JB Nizet Feb 08 '14 at 16:52
  • @JBNizet Can you use the disk for java's heap? – takendarkk Feb 08 '14 at 16:53
  • @JB Nizet, how can I tell Eclipse/Java to use the memory in my HDD? I still have around 100GB free (I hope its possible :-)) – P A S T R Y Feb 08 '14 at 16:53
  • The swap config is done at the OS-level, not at the JVM level. But that is not a suitable solution anyway. Your program would be dog slow. If you need more memory, then buy some, or optimize the memory consumption of your program. – JB Nizet Feb 08 '14 at 16:56

1 Answers1

1

Eclipse itself is a Java program, that needs some memory to run. You can tweak the heap size used by Eclipse using the eclipse.ini file.

Eclipse also launches your program, in a separate JVM. You can tweak the memory settings used for your program by editing the run configuration used to launch this program.

If you tried setting that to a huge value, and your program still fails with OutOfMemoryErrors, then either you need even more memory, or you should optimize your code to make it use less memory.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255