I’m working to upgrade my Hibernate version to 5.3. I’ve noticed that by default the legacy batch fetch style is being used by default (LegacyBatchingEntityLoader).
This style with a default batch fetch size of 50 and in combination with my model which contains hundreds of entities with different proxies is giving me a retained heap of 950 MB by the SessionFactoryImpl class once Hibernate is set up.
However, using the dynamic fetch style this retained size is reduced to 100MB…which is a considerable difference.
I would like to know:
- Why is the legacy style the default option?
- Do you have any kind of benchmark/recommendations that I can follow to decide which is the best approach to take?
Thanks in advance.