Eclipse and OutOfMemory Exceptions
Posted by Anandhan Subbiah on Jul 27, 2007 in Java, Technical Articles • 1 commentAny developer using eclipse would have seen the “out of memory” exception . The immediate resolution that might come to mind is to increase the heap size . Something like
-vmargs -Xmx512m
But that does not really solve the issue as even with these settings there is a very good chance of getting the out of memory error. The perm space is the key.The VM’s permSpace is the area of the VM that is used to store data structures and class information (not instances, but the class definitions themselves). In the case of a large enough Java application that may contain 10s of thousands of class files that must be loaded you start to see how the VM can physically run out of space storing all of that information into the default permspace.
There are two ways to handle this . You can make the changes in eclipse.ini or you can change the shortcut for eclipse. For e.g. I use myeclipse 5.5
C:\programs\eclipse\eclipse.exe -product com.genuitec.myeclipse.product.ide -vmargs -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m
I have 2GB RAM . But it is a good idea to test eclipse using diffrent memory models.

Thanks Hesham! Nobody has done it till now – it’s good to know I’m anearpptly the first Have a great weekend too!