We bumped spring boot from 2.1.9 to 2.2.2 not so long ago, and right after that we started getting OOMs from time to time ( 7-8 times a day). After downloading the heap-dump a few times through the actuator endpoint, I see that the memory gets filled with items in ConcurrentHashMap under PartTreeJpaQuery.QueryPreparer.

No special config except for:

spring.jpa:
    open-in-view: false
    properties.hibernate:
      generate_statistics: true
      query:
        plan_cache_max_size: 64
        plan_parameter_metadata_max_size: 32

and dependency for spring-boot-starter-data-jpa.

After checking the issues under milestone 2.2.0, 2.2.1 and 2.2.2, I see 2x upgrades of Hibernate but no other mentions.

I checked spring-data-jpa, found no special changes there lately that should have had this effect.

Comment From: mbhave

PartTreeJpaQuery` is part of Spring Data which uses JIRA for issue tracking. If you'd like to discuss the problem with the Spring Data team, please open a JIRA ticket.

Comment From: kgunnerud

Great, thanks. The issue has already been reported there I see and a fix is in PR if anyone else wonders about this: https://github.com/spring-projects/spring-data-jpa/pull/402