UnmappedResourceHandler似乎正在资源文件夹中加载复合组件xhtml文件。结果似乎是一个逐渐增加的内存泄漏。
泄漏可以在FaceletViewHandlingStrategy.metadataCache中找到。它依赖于hashmap,当使用上面的处理程序时,UnmappedResources被用作CompositeComponentBeanInfo实例的键。
如果没有使用UnmappedResourceHandler,则密钥包含ResourceImpl。不同之处在于,UnmappedResource不像ResourceImpl那样实现equals():
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ResourceImpl resource = (ResourceImpl) o;
return resourceInfo.equals(resource.resourceInfo);
}因此,问题似乎是,在第一种情况下,CompositeComponentBeanInfo一次又一次地添加到metadataCache中。在第二阶段,一切都如预期的那样工作。
还有人能证实这个问题吗?
https://stackoverflow.com/questions/30614722
复制相似问题