Sometimes, when rebuilding some large projects you can run out of PerGem space, here’s a solution.

As far as I know, this can also happen in some application servers after some running time, in this case this solution won’t solve the problem, it will only occur later.

In Eclipse, to avoid this error, that makes you end with a half compiled application and rebooting eclipse, the only thing you have to do is to start eclipse with this settings:

-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=128m

Remember also that adding -Xmx512M (at least) it’s a good idea.