0

I'm using Eclipse Juno. I have a workspace with 100 or so classes and interfaces spread out over 5 projects. According to a code metrics utility there are about 5,000 lines of code. I have about 5 .java files open.

While I'm running unit tests and saving code, I keep getting this error (It happens as a result of either, sometimes, but not necessarily the first time):

"Error iterating over database keys

Java heap space"

I've tried restarting Eclipse and restarting my computer and the error remains.

My eclipse.ini file looks like this (I edited it per recommendation of this: Out of memory error in eclipse.why?)

-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20120522-1813
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms512m
-Xmx512m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:PermSize=128m
-XX:MaxPermSize=128m
Community
  • 1
  • 1
Jesus is Lord
  • 14,971
  • 11
  • 66
  • 97

3 Answers3

1

Try increasing your heap:

-Xmx1024m

http://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F

Christiaan
  • 2,637
  • 21
  • 26
1

That's enough memory for what you have. Sounds like one of your unit tests is processing a result set that's gigantic (bad idea). Show us that code, but seems like this is only happening when you run one particular test, right?

Rob
  • 11,446
  • 7
  • 39
  • 57
  • Result set? This application does not interface with a database if that is what that refers to. And it sometimes happens as a result of editing a .java file and saving - not just doing unit tests. – Jesus is Lord Jan 25 '13 at 14:33
  • I guess it was: Error iterating over database keys that made me think you were interfacing with a database? – Rob Jan 25 '13 at 16:08
1

Eclipse needs a lot of memory. On a 32-bit machine, I set both mn and mx to 2048m. On a 64bit machine I use 4096m for those values. The reason I do that is because when I ran Eclipse with those values not set on a JDK that was self-tuning, it ran the heap all the way up to using 4G on a moderate sized project. Otherwise, I end up having to re-start it at least every day so it frees up all of the little bits of memory it tucked away and forgot about.

rakehell
  • 323
  • 2
  • 11