The permgem space is one of the most irritating errors in glassfish.
The permgem space is an error that appears when you use a lot of deploys or redeploys in the server, because the server reserves memory and never frees it. I recommend you to supervise the server with Apache JMeter to see the amount of memory (and if it is near the max, restart it before it crash).
To temporary fix it, you must include some variables in the server to improve his memmory consumption in the glassfish administrator like said amccormack.
I recommend you to use
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+CMSClassUnloadingEnabled
By the way, if the permgem space error appears, the server will not respond (even to asadmin stop-domain) . But you can easily restart if you kill the java process that runs glassfish and call asadmin start-domain. I think that it is quicker than restart all the server.