Java Tomee WebContext未发布CreationContext

Java Tomee WebContext未发布CreationContext,java,memory,apache-tomee,openejb,Java,Memory,Apache Tomee,Openejb,我在使用Tomee、ApacheOpenWebBeans和JSF时遇到了相当严重的内存泄漏 org.apache.openejb.core.WebContext中的以下代码每次导航到页面时都会不断添加元素,但从不删除它们: if (webBeansContext != null) { final InjectionTargetBean<Object> bean = InjectionTargetBean.class.cast(beanDefinition); bean

我在使用Tomee、ApacheOpenWebBeans和JSF时遇到了相当严重的内存泄漏

org.apache.openejb.core.WebContext
中的以下代码每次导航到页面时都会不断添加元素,但从不删除它们:

if (webBeansContext != null) {
    final InjectionTargetBean<Object> bean = InjectionTargetBean.class.cast(beanDefinition);
    bean.getInjectionTarget().inject(beanInstance, creationalContext);

    creatonalContexts.put(beanInstance, creationalContext);
}
if(webBeansContext!=null){
final InjectionTargetBean=InjectionTargetBean.class.cast(beanDefinition);
getInjectionTarget().inject(beanInstance,CreationContext);
creationalcontexts.put(beanInstance,creationalContext);
}
产生JSF对象及其相关CreationContext的海量映射,这些对象永远不会被垃圾收集:


最终,这将导致服务器内存不足并崩溃。有人遇到过这种情况吗?

您使用哪个(发布)版本的OpenEJB/TomEE来发现这种行为?TomEE 1.7.2。我意识到我们将JSf的(Majorra)实现作为
运行时
而不是
提供的
依赖项,因此它包含在war文件的lib中。删除此依赖项并依赖于Tomee lib中的实现解决了此内存泄漏问题,尽管我不确定原因(可能是由于默认注入范围)。您使用哪个(已发布)版本的OpenEJB/Tomee来查找此行为?Tomee 1.7.2。我意识到我们将JSf的(Majorra)实现作为
运行时
而不是
提供的
依赖项,因此它包含在war文件的lib中。删除此依赖项并依赖于Tomee lib中的实现解决了此内存泄漏问题,尽管我不确定原因(可能是由于默认注入范围)。