Query plan cache memory leak after cleanup

Description

After a QueryPlanCache.cleanup() the cache still retains a lot of memory (~500MB), but it should be empty.
I empty the cache using the *entityManager *as follows:

After the cleanup I did a heapdump and notices that the segments tables were cleared but the evictions LIRS header was not, causing the memory leak issue.
From the LIRS source code, only the accessQueue is cleared:
org\hibernate\internal\util\collections\BoundedConcurrentHashMap.java (line 1096):

Heapdump screenshot in Eclipse MAT:

Environment

Java 1.8.0_162, JVM: Java HotSpot(TM) 64-Bit Server VM (25.162-b12, mixed mode), Windows 10, Postgres 10

Status

Assignee

Unassigned

Reporter

Alex CD

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure