We run a large java based application that is under heavy development. Every 3 to 6 months it seems we have to increase the size of the PERM memory or we risk running out of memory either when the application starts or shortly after coming online. The application is hosted in JBoss 4.2 and tomcat servers.
Our current setting are:
-server -Xms12G -Xmx12G -XX:MaxPermSize=1536M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode
I can help but wonder if this seems awful high.
The PERM memory seems to fill up very quickly on startup. anywhere between 90 to 99% using jstat.
Our web application consists of 30 plus individual war files. In JBoss these are deployed as one large 300MB+ ear file.
Is it normal for a large application to us this much PERM?
That is hella lot of permgen space. If it fills up right away, that implies an almost inconceivable number of classes. Is there a lot of duplication in libraries across those 30 war files? You could save a lot of space by loading common libraries from a common classloader closer to the root, rather than in each separare webapp. Try installing common libraries in the server directories.