Add a comment about what you can expect from a query plan cache cleanup

Description

Hello!

We found possible memory leak in BoundedConcurrentHashMap.LIRS implementation.

I think that problem is in a org.hibernate.internal.util.collections.BoundedConcurrentHashMap.LIRS.clear() method.

This method clear an accessQueue variable but LIRS stack (represented by a header variable) is not cleared.

I attached an image from heap analysis to demonstrate this problem.

In this example SessionFactoryImpl is properly closed (method close() is called on every instance of LIRS).

Thanks,
Samuel

Environment

None

Status

Assignee

Guillaume Smet

Reporter

samuel brezani

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.3.11
5.2.14
5.0.9

Priority

Major
Configure