Sun JVM has a PermGen space setting that is a SEPARATE allocated memory region that is used for allocating classes. This is actually the memory region most people have issues with and not so much the normal heap space. The JVM just says “Out of Memory” or simply just crashes. Crappy error message.
The solution for this is to add a MaxPermSize value to the vmargs. e.g. I normally use -XX:MaxPermSize=128m to make sure I don’t run out of PermGen space.