PermGen is the area of your JVM memory that is used to load classes.
As soon as the application runs, it uses more and more of this memory, especially if you are in a debugging environment, if you use closure extensively.
To fix it, add it more!
This is done by passing one or two JVM parameters at application startup.
Options:
-XX:MaxPermSize=256m -XX:PermSize=128m
(adjust the values for your specific needs)
PermSize will be the initial size of PermGen, and MaxPermSize will be the maximum size it will increase before throwing an exception to you, as in your message.
By default, it is set to 64M , which is not enough if you have a "real" application.
ATTENTION: Your total memory usage will be: Heap size + Perm Size
source share