|Re: ValueHolder eats memory [message #522504 is a reply to message #522310]
||Mon, 22 March 2010 20:01
| James Sutherland
Registered: July 2009
Location: Ottawa, Canada
The UnitOfWork is only cleared if you call clear(), otherwise, the value holders still require the unit of work to maintain object identity if they are instantiated.|
But even if you do not use value holders, holding these object in your app permanently would be a memory leak, as not only the objects, but also everything they reference will be held in memory. What in your app is holding onto these objects, and why? Can you clear the references to them?
Otherwise, you could call clear() on your EntityManager when you are done with it.
EclipseLink also offers a weak reference mode, which may be of interest,
http://www.eclipse.org/eclipselink/api/2.0.1/org/eclipse/per sistence/config/PersistenceUnitProperties.html#PERSISTENCE_C ONTEXT_REFERENCE_MODE
James : Wiki : Book : Blog : Twitter
Powered by FUDForum
. Page generated in 0.02625 seconds