I'm dealing with a big application that have hundreds of hibernate entities and EAGER
associations. When I start this application the memory consumption is very high (more than 1 GB).
Looking in the JVM heap dump of the application just after started, I analyzed and understood that the most of the memory is occupied by char[]
with different SELECT
statements from different entities of the application.
I suppose that this SELECT
s are generated by the query plan cache of the Hibernate.
I would like to limit the size of this cache for the development environment. I tried to limit the size with some properties:
"hibernate.query.plan_cache_max_size", "16" //default is 2048
"hibernate.query.plan_parameter_metadata_max_size", "16" //default is 128
But there is no difference in the memory consumption.
What I'm supposed to do to limit the cache of Hibernate queries?
I'm using Hibernate 5.0.10.