MaTransaction memory hog
Igor Stasenko
siguctua at gmail.com
Fri Oct 23 21:51:22 UTC 2009
2009/10/23 Carlo <snoobabk at yahoo.ie>:
> Hi
>
> First off I'd like to say what a pleasure working with Magma has been so far
> and I haven't even got to the HA functionality :)
>
> I noticed in my little app that memory was increasing over a few days. I
> think I pinpointed it to MaTransaction not finalizing the readSet.
> i.e. in MaTransaction>>initialize
> super initialize.
> readSet := MagmaPreferences weakIdentityKeyDictionaryClass new.
> largeCollectionChanges := WeakSet new.
> self resetCommitPackage.
> ignoreModifiedSignals := false.
> "Conveniently initialized to avoid nil check in code."
> commitNumber := 0
>
> I modified the initialization of the readSet to be registered with the
> finalization process (WeakArray addWeakDependent: readSet.) i.e
> super initialize.
> readSet := MagmaPreferences weakIdentityKeyDictionaryClass new.
> WeakArray addWeakDependent: readSet.
> ...
>
> So far memory has improved and sits around 70mb consistently.
> Hopefully this will be helpful for someone else.
As far as i remember, Magma using own means to finalize values in
readset and rehash it.
Registering readset in finalizatin process is a bit dangerous, because
we had experienced some problems
with it before - i.e. corruption of magma internal structures, because
of race conditions.
> Cheers
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>
--
Best regards,
Igor Stasenko AKA sig.
More information about the Magma
mailing list