Avdhoot
Avdhoot

Reputation: 61

Eclipse heap space (out of memory error)

I am facing memory issue in eclipse. Initially I was getting this error: ‘Unhandled event loop exception java heap space’ and also sometimes ‘An out of memory error has occured’.

I somehow managed to increase my heap size upto -Xmx990m. But still its not working. When I try to increase heap size beyond that, I am getting error ‘Unable to create virtual machine’ while starting eclipse.

I tried to make other changes in eclipse.ini file. When I change XXMaxPermSize, it gives me ‘permGen memory error’. For few times, I got different other kind of errors like ‘Unhandled event loop exception GC overhead limit exceeded’ and 2-3 more different types. Please help me what can be done that would be great!

Upvotes: 6

Views: 45737

Answers (3)

vish0910
vish0910

Reputation: 49

I faced similar situation. My program had to run simulation for 10000 trials. I tried -Xmx1024m : still it crashed.

Then I realized given my program had too much to put up on console; my console-display memory may be going OOB.

Simple solution=> right-click console > preferences > Check Limit console output > Enter Buffer size(characters)[Default: 80000].

I had unchecked it for analyzing single run, but when the final run had 10000 trials, it started to crash passed 500 trials.

Today was the day: I thought three times, that how programming in Java helps me skip the whole job memory deallocation and cursed C for the same. And here I am, spent last 2 1/2 hours to find how to force GC, how to dellocate variable( By the way, none was required).

Have a good day!

Upvotes: 2

PSR
PSR

Reputation: 40358

I also faced the same problem.I resolved by doing the build by following steps as.

-->Right click on the project select RunAs ->Run configurations

Select your project as BaseDirectory. In place of goals give eclipse:eclipse install

-->In the second tab give -Xmx1024m as VM arguments.

Upvotes: 4

machineghost
machineghost

Reputation: 35725

Jeshurun's somewhat flippant comment about buying more RAM is actually fairly accurate. Eclipse is a memory HOG! On my machine right now Eclipse is using 2.1GB; no joke. If you want to be able to use Eclipse really effectively, with all the great features, you really need lots of memory.

That being said, there are ways to use Eclipse with less memory. The biggest helper I've found is disabling ALL validators (check "Suspend all validators" under Window>Preferences>Validation; just disabling the individual ones doesn't help enough). Another common source of memory-suckage is plugins. If you're going to stay at your current memory limit, I strongly recommend that you:

  1. Uninstall your current Eclipse
  2. Download the core/standalone/just Java version of Eclipse (the one with least filesize/no plug-ins built-in)
  3. Try using just that for awhile, and see how the performance is. If it's ok, try installing the plug-ins you like, one at a time. Never install multiple, and give each one a week or two of trial.
  4. You'll likely find that some plug-ins dramatically increase memory usage; don't use those (or if you do, get more RAM).

Hope that helps.

Upvotes: 9

Related Questions