The problem was that I was creating another context inside the cycle (in a called method) and copying some objects to it, trying to save, catching OL exceptions, etc. It's that technique I described on my blog: create very very localized EC, do stuff on it, try to save, if it goes wrong, trash the EC, create new EC, try again, etc.

Well, that EC was not being disposed. I disposed it, and suddenly memory usage did not grow any more.

Now, why did it worked is what I don't understand. Shouldn't ECs be disposed and discarded automatically, by the GC, as soon as they are not referenced any more? Or does that happen only on the end of the RR cycle? Or what?
You're using Wonder, right? I think it pushes EC's into a ThreadLocal so it can do automatic unlocking for you, which means it will not be eligible for GC. I think that should be switched to a Weak(List/Set/whatever) so that it doesn't hold onto it if it's the last one and just let it GC. I don't exactly know what the unlocking semantics of that should be ...

ms

Hi Mike -

Just to clarify: if we use an ERXEC for a temporary job and no longer need the EC afterwards we should explicitly dispose() it to mark it for the GC ? Otherwise it will stick around forever ?

Simon


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to