Wednesday, September 29, 2010

Eclipse crashing & workspace in use?

I use Eclipse with PDT at work. True it may be a memory hog but I love using it now.

I usually edit the eclipse.ini file in the eclipse/ folder and increase the memory usage of it.

For e.g. for 512MB RAM, I set:

-Xms256m -Xmx256m -XX:PermSize=64m -XX:MaxPermSize=64m

Here are some more configurations.

Another common problem is eclipse crashing. When you restart it, it may say that your current workspace is in use and you need to choose another workspace.

This is because there is a .lock file hidden in your .metadata/ folder in your eclipse/ directory. This file is created when eclipse starts and is deleted at every proper shutdown of eclipse. So if eclipse crashed, sometimes it would not have deleted .lock file and hence it thinks there is another eclipse program running. Delete the .lock file and you are on your way.