简体   繁体   English

Java PERM等于多少(1.5GB似乎很高)

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

We run a large java based application that is under heavy development. 我们运行一个正在开发的基于Java的大型应用程序。 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. 似乎每隔3到6个月,我们就必须增加PERM内存的大小,否则我们可能会在应用程序启动时或联机后不久出现内存不足的风险。 The application is hosted in JBoss 4.2 and tomcat servers. 该应用程序托管在JBoss 4.2和tomcat服务器中。

Our current setting are: 我们当前的设置是:

-server -Xms12G -Xmx12G -XX:MaxPermSize=1536M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -服务器-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. PERM内存似乎在启动时很快就装满了。 anywhere between 90 to 99% using jstat. 使用jstat的90%到99%之间的任何值。

Our web application consists of 30 plus individual war files. 我们的Web应用程序包含30多个单独的战争文件。 In JBoss these are deployed as one large 300MB+ ear file. 在JBoss中,它们被部署为一个300MB +的大文件。

Is it normal for a large application to us this much PERM? 这么大的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? 在那30个战争文件中的库中有很多重复项吗? 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. 通过从更靠近根目录的公共类加载器(而不是在每个分离的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. 尝试使用诸如JProfiler或Eclipse MAT之类的探查器工具来分析应用程序的内存使用情况。 I have seen that simple memory leaks can cause huge disruptions over a period of time. 我已经看到,简单的内存泄漏会在一段时间内导致巨大的中断。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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