Q. How to fix Out of memory error that occurs at runtime when you run out of the JVMs permanent memory
A. Increasing the -Xms and -Xmx only increases the runtime heap allocation, but does not increase the permanent memory allocation (which is used to store classes, interned strings, etc.).
If you are using a JDK from Sun Microsystems, you can also use MaxPermSize
Example -Xms512m -Xmx1024m -XX:MaxPermSize=256m