|
For bytecode enhanced reference cached read-only entities, a EntityEntry object is referenced by the enhanced referenced cached in the 2lc. In the case where the entity is Immutable the state of EntityEntry should be immutable after the entity has been loaded.
At present, a new EntityEntry is instantiated every time the entity is added to a PeristenceContext. Is it possible to share the EntityEntry between sessions if we know that the entity is immutable?
In our use case, EntityEntry is the No. 1 object in terms of amount of Memory allocated, and by reusing the EntityEntry we could potentially reduce the Heap Allocation rate by ~50% for this object
|