每隔几分钟,wildfly 就会产生巨大的垃圾。虽然 Full GC 能够回收内存,但这会导致频繁的 full gcs,因为由于创建的对象数量的增加,堆被占用。我们可以在 60 个用户的 Jmeter loadtest 中重现此问题。Jboss 7.1.1Final 中并非如此。
在分析堆转储后,创建了巨大的字符数组,它们不是被 Minor GC 收集的垃圾。char 数组的传入引用表明它们对 io.undertow.servlet.spec.HttpServletRequestImpl 具有有效引用。但是完整的 gc 能够恢复内存。不知道为什么 io.undertow.servlet.spec.HttpServletRequestImpl 中的属性没有被次要 gc 的 gced。
“org.apache.struts.tiles.ComponentContext”由 io.undertow.servlet.spec.HttpServletRequestImpl 保存在属性 Map 中。org.apache.struts.tiles.ComponentContext 包含一个大字符数组。我们怀疑undertow有问题。
从附加的 Eclipse MAT 获得的图像 https://www.dropbox.com/sh/qgsitzb7x27j8kc/AABoQwR1qPwTPiDtO6B0_Pm7a?dl=0