为什么在dump中会有这么多SessionFactoryImpl对象?

问题描述 投票:0回答:1

我的dump中有大约15,000个相同的SessionFactoryImpl对象。

enter image description here

其中一个对象有入站引用

enter image description here

其中一个对象有入站引用: 一个对象有出站引用:

enter image description here

我没有配置以下参数,它们都是默认设置的。

hibernate.query.plan_cache_max_size
hibernate.query.plan_parameter_metadata_max_size

问题:为什么有这么多SessionFactory对象?

  1. 为什么有这么多SessionFactoryImpl对象,为什么没有被删除?
  2. 是代码中某个地方创建的不正确,还是因为没有指定缓存参数?
  3. 如果是,我应该为缓存设置什么参数?
  4. 我应该设置其他的设置吗?
  5. 如果这些对象是在代码中创建的,我如何在Jprofiler中找到创建这些对象的类?

版本:Hibernate 5.4.1

  • Hibernate 5.4.3.Final。
  • Spring 5.1.6.发布
java spring hibernate jprofiler
1个回答
0
投票

也许你可以通过使用 "Show Selection In Heap Walker "找到创建SessionFactoryImpl对象的代码行号,并在 "Allocations "中观察对象的分配树。

© www.soinside.com 2019 - 2024. All rights reserved.