简体   繁体   中英

How much is to much PERM in Java (1.5GB seems high)

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.

1.5 GB的开销来管理12 GB的堆以及类代码/静态数据真的如此离谱吗?

Have you considered that there may be a memory leak in your application? Try using a profiler tool like the JProfiler or the Eclipse MAT to analyze the memory usage of your application. I have seen that simple memory leaks can cause huge disruptions over a period of time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM