-
Notifications
You must be signed in to change notification settings - Fork 700
Closed
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Milestone
Description
Hi,
it looks like there is a bug in RepositoryFactorySupport in combination with QuerydslPredicateExecutor causing the repository information cache map to grow indefinitely, which eventually leads to OOM:
Heap usage in version 3.4.3 (same for 3.4.x):

Steps to reproduce and observed behaviour
I'm attaching a sample application below which is based on Spring Data REST, Spring Data JPA and Querydsl:
spring-repository-cache-map-issue.zip
- Each HTTP resource request (GET /someItems) will produce a unique entry in repository information cache (
repositoryInformationCache) - So the number of entries in the map will be equal to number of executed HTTP requests
- The
cacheKeyis always unique because itscompositionHashis calculated fromQuerydslJpaPredicateExecutorwhich doesn't overridehashCodemethod.

The thing is, it behaves the same in version 3.3.9 as well. But there was:
new ConcurrentReferenceHashMap<>(16, ReferenceType.WEAK)
(changed in #3067 - b21b2e8)
so if I understand correctly, the values were always garbage collected because of the WEAK reference type.
Metadata
Metadata
Assignees
Labels
type: regressionA regression from a previous releaseA regression from a previous release
