简体   繁体   English

内存不足:带有 wildfly 和 groovy/jasper 的元空间

[英]Out of Memory: metaspace with wildfly and groovy/jasper

On our Wildfly 10 applicationserver we are using groovy for jasperreports and other similiar systems.在我们的 Wildfly 10 应用服务器上,我们将 groovy 用于 jasperreports 和其他类似系统。 After some time the jvm (java 8) gets an "Out of Memory: metaspace" error.一段时间后,jvm(java 8)收到“内存不足:元空间”错误。 The same issue happens on some older jboss 4 servers with permgen (java 6).同样的问题发生在一些带有 permgen (java 6) 的旧 jboss 4 服务器上。 We upgraded jasperreports from 3.7.2 to 6.3.1 and the problem still exists.我们将jasperreports从3.7.2升级到6.3.1,问题依旧。 The size of permgen/metaspace is big enough (Max 512 MB). permgen/metaspace 的大小足够大(最大 512 MB)。

Our other applications that do not use jasperreports and groovy do not have this problem.我们其他不使用 jasperreports 和 groovy 的应用程序没有这个问题。

After some research i recognized that this is possibly a memory leak in a classloader ( stackoverflow question ).经过一些研究,我意识到这可能是类加载器中的内存泄漏( stackoverflow 问题)。 It seems that the gc does not unload classes generated from groovy.似乎 gc 不会卸载从 groovy 生成的类。

On jaspersoft documentation they write, that u should set -XX:+UseConcMarkSweepGC and -XX:+CMSClassUnloadingEnabled as VM Parameter to enable class unloading.在他们编写的jaspersoft 文档中,您应该将-XX:+UseConcMarkSweepGC-XX:+CMSClassUnloadingEnabled为 VM 参数以启用类卸载。

So we changed it but the problem still exists.所以我们改变了它,但问题仍然存在。 Does Java 8 still support these Parameters? Java 8 是否仍然支持这些参数? If not is there any other solution.如果没有,是否还有其他解决方案。 Currently we have to restart the server every night to avoid this problem.目前我们必须每晚重启服务器才能避免这个问题。

As Durandal mentioned mentioned in the comments of the question, there where a lot of "sun/reflect/DelegatingClassLoader" and "org/codehaus/groovy/runtime/callsite/CallSiteClassLoader" entries in the heap dump.正如 Durandal 在问题的评论中提到的,堆转储中有很多“sun/reflect/DelegatingClassLoader”和“org/codehaus/groovy/runtime/callsite/CallSiteClassLoader”条目。 It seems that groovy has some memoryleak issues.似乎 groovy 有一些内存泄漏问题。 We changed the script enginge from groovy to java for jasper reports and javascript for our other systems.我们将脚本引擎从 groovy 更改为用于 jasper 报告的 java 和用于我们其他系统的 javascript。 This solved the Problem.这解决了问题。 Thanks for the help.感谢您的帮助。

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

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