问题现象:
一个后台服务在运行一段时间后,观察内存一直在增加,使用MAT工具,打开堆文件分析内存泄漏情况:fileName_Leak_Suspects的index
发现如下提示:
One instance of "org.hibernate.internal.SessionFactoryImpl" loaded by "org.springframework.boot.loader.LaunchedURLClassLoader @ 0x2c00204b8" occupies 8,137,929,888 (98.05%) bytes. The memory is accumulated in one instance of "org.hibernate.internal.util.collections.BoundedConcurrentHashMap$Segment[]" loaded by "org.springframework.boot.loader.LaunchedURLClassLoader @ 0x2c00204b8".
Keywo