So, I analyzed the dumps yesterday evening. The problem is real, meaning
his SessionFactory is consuming more than 1GB of memory for 600+ tables,
some with a lot of attributes. So for sure, the model is a big one, but it
would be nice to be more gentle with this type of configuration. I don't
think it's something new to 5.3 though as it's not the first time we have
this type of reports.
From my observations, the problem mostly comes from:
\_ loaders - EntityLoader
\_ staticLoadQuery - EntityLoadQueryDetails
\_ rootReturn - EntityReturnImpl
The largest LegacyBatchingEntityLoader I have in the dump takes more than 2
Keep in mind that with a batch size of 50, we have 13 EntityLoaders for
batch sizes of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 20 and 50, each loader
taking ~ 200 KB.
We discussed some ideas yesterday with Steve.
I'll try to experiment a few ideas next week to see if I can come up with
some mitigation. I'm not that familiar with the ORM source code so I'm full
of crazy ideas to try - most of them will probably prove to be bad (Steve
already shut some of them) but maybe one will survive and be beneficial to
the problem at hand.
I'll keep you posted if I can come up with something.