[hibernate-dev] SingleTableEntityPersister memory footprint in 5.3

Guillaume Smet guillaume.smet at gmail.com
Fri May 4 08:41:21 EDT 2018


On Fri, May 4, 2018 at 11:48 AM, Sanne Grinovero <sanne at hibernate.org>
wrote:

> thanks for investigating. Steve in chat mentioned the option of
> creating these EntityLoaders lazily: as while they need to be reused,
> it's possible many of them are never really used.
>
> I think that's a very interesting observation, is that what you plan to
> explore?
>

Yes, it's one of the things we should explore.


> I see two difficulties:
>  - you'd need thredsafe code, yet we don't want barriers on this area.
> Will probably need features such as lazy set, yet these would need
> even more objects allocated if you're not careful.
>  - we always prefer fail-at-boot validation, so we'd need to make sure
> even if you don't build them all, we can at least make sure we'll be
> able to build them later.
>

Well, the idea is to prototype something on the memory usage front, then we
can discuss further what we want to do with it and if it's worth refining
it and spending more time on it.

If we end up choosing this path, be sure we'll be bugging you for advice on
concurrency and performance :).


> Additionally there's the idea to see if any such Loader instance could
> be reused - probably using a cache which we clear at end of bootstrap
> - yet since Steve mentioned this would be a significant change let's
> not try to push it in 5.3.
>
> Finally, a simple one: I have the impression that loader's Map could
> be made into a plain array, or a custom structure which would then be
> ideal to support lazy creation of loaders. With the exception of two
> special strings - which will needt to be treated specially - all other
> keys are enums.
>

Yeah, I'll play with a few ideas and see what I can do. I'm not yet sure if
not knowing the code base will be a thing in my favor or not. At least I
don't have preconceived ideas :].


> Whatever you choose to try, let's keep significant changes for 6 only :)
>

Steve was saying that this whole thing wouldn't be an issue in 6.

-- 
Guillaume


More information about the hibernate-dev mailing list