I have a situation where we are ONLY inserting objects into the database
and not ever reading them from the application that is creating them. We
will be generating millions of these records per month.
In the short term since no one is yet reading them, it seems to me the
least impact on memory of the application creating them would be to use
NoIdentityMap option for those classes vs WeakIdentityMap. However,
several places in EclipseLink docs it says that NoIdentityMap is not a
recommended option since there is no guarantee of object identity.
So for the case described above, is NoIdentityMap going to save on memory
usage over WeakIdentityMap?
I did some tests with both caching options and the memory usage results
were about the same. In some cases the NoIdentityMap option was slightly
better and in other cases the WeakIdentityMap caching option's memory
usage was slightly better.
So, my conclusion is to stay with the WeakIndentityMap caching option.