|QueryValueHolder Strategy for Better Memory Management [message #388460]
||Fri, 29 May 2009 20:20
Registered: July 2009
We've been using TopLink (EclipseLink now) for 6 years and have a very |
large application with hundreds of tables mapped.
In addition to the large number of objects, our persistence framework has
a lot of interlinking (many 1-M and 1-1 back reference mappings throughout
the application). The object graph that is loaded into memory is extremely
In instances of our application where datasets are very large we are
running into the situation where the GC cannot free memory because active
threads retain hard references to objects, which, because of
QueryValueHolder, retains hard references to related objects throughout
our object model. This is true regardless of the setting in the
For several reasons not worth exploring on this thread, we cannot remove
these ValueHolder references.
An interesting idea came out of our internal discussions and I wanted to
post it to this forum to learn if this approach had any merit.
We would like to create an implementation of ValueHolder (we would assume
QueryValueHolder) with the following properties:
1) It would have a "reinitialize()" method that would release it's hold on
any loaded objects and be treated as if it had never loaded anything from
2) Have the ValueHolder retain the reference to these objects via a
WeakReference so that these relationships could be GC'd (and reloaded, if
Would this approach be worth exploring? What would break?
Powered by FUDForum
. Page generated in 0.01918 seconds