Why do I get message: "Unhandled event loop exception Java heap space" in Eclipse when using javascript autocomplete? Why do I get message: "Unhandled event loop exception Java heap space" in Eclipse when using javascript autocomplete? javascript javascript

Why do I get message: "Unhandled event loop exception Java heap space" in Eclipse when using javascript autocomplete?


This error is a 'classic' for any Eclipse user. Open the folder in which you have your eclipse. There, edit the "eclipse.ini" file.

Locate the line on which there is "-vm". Under this line, you have three generic settings for the memory. In short :

  • "Xms" is the minimal amount of memory allocated to the virtual machine.
  • "Xmx" is the maximal amount.
  • "MaxPermSize" is the amount of memory allocated to the permgen of the virtual machine.

The exception with the error message you have here means that java has reached its maximum memory setting, yet it needs more. Java taking 100% of the CPU in such cases is "normal" : the garbage collector is working full time. The one setting you want to edit is "Xmx" which will give a little more memory for Java to breathe, but it does not hurt to set the other two a little higher too. My usual settings are :

  • -Xms256m
  • -Xmx1024m
  • -XX:MaxPermSize=256m


I managed to find the problem. I temporarily moved some js files to my project (some of them duplicated the original ones) and auto-complete was searching in too many files. So I changed the src folder like this:

  • Right click on project
  • Choose properties
  • Javascript
  • Include path
  • On the source tab I excluded the files/folders that were duplicated and some that I didn't want to use on auto-complete.

This solved my problem and my Eclipse is fast now on auto-complete.


(1) Go to the open lunch configuration then go to the arguments add this

     -Xms512m    -Xmx1024m-XX:MaxPermSize=512m