We are running grails and we are noticing multiple full garbage collections are needed to clear out the permgen space.
2013-06-06T16:11:27.016+0000: 32582.145: [
One way to identify what is being collected in that last FullGC collection is to print class histograms before/after Full GC: -XX:+PrintClassHistogramBeforeFullGC -XX:+PrintClassHistogramAfterFullGC
.
This way you can compare histograms from all collections and identify which classes are collected in the last one.
To your second question considering PermGen, the usual advice is to identify the sufficient size of the PermGen for your application/workload and stick with that. You need to investigate why there is so many objects being placed into the PermGen.