Re: Out of memory
Re: Out of memory
- Subject: Re: Out of memory
- From: Mike Schrag <email@hidden>
- Date: Thu, 29 Nov 2007 21:01:40 -0500
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden