You could consider a manual garbage collection to free up those resources. I'm not a GC guru, so I can't guarantee it will do what you want, but I'd give it a try. I believe the method is on ObjectMemory somwhere.
Ragnar Hojland Espinosa wrote:
On Tue, Oct 22, 2002 at 03:55:39PM +0100, Peter Crowther wrote:
I can't find out how to write a destructor or something functionally equivalent.
Check out implementors of 'finalize' (IIRC). In essence, you hold onto the object using a weak array; are notified when it is garbage-collected; and clear appropriate fields based on copies of the data in the object.
Finalize did get some nice matches. Does finalize get called right away, or only when squeak does the GC? And if so, am I guaranteed that it'll be GCed that moment?
The thing is.. I'm leaving behind lots open postgres connections which would be nicely closed with a "destructor", and right now I don't know how to automatically close (maybe you cant?) when it should (the sooner the better). Obviously, postgres complains quite loudly when you have too many open, and things suddely get very ugly.
Ah well.. at least I can add the closes by hand :/ but that means leaks and sort of rules out to have decent db connection pools in any way I can think of.. so I must be missing something.