Jesus is Lord
Jesus is Lord

Reputation: 15399

Eclipse suddenly started giving this error

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

Upvotes: 0

Views: 338

Answers (3)

rakehell
rakehell

Reputation: 338

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.

Upvotes: 1

Rob
Rob

Reputation: 11733

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?

Upvotes: 1

Christiaan
Christiaan

Reputation: 2725

Try increasing your heap:

-Xmx1024m

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

Upvotes: 1

Related Questions