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. Cheers
2009/10/23 Carlo snoobabk@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@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
Earlier this year, I had switched Magma over from requiring applications to #finalizeOids to registering with WeakArray. Apparently, I missed one! Thanks, I will fix that.
sig, I have not experienced any problems myself since making the above-mentioned change. There are no race conditions that I am aware of, can you elaborate about the problems you experienced?
Thanks, Chris
On Fri, Oct 23, 2009 at 4:51 PM, Igor Stasenko siguctua@gmail.com wrote:
2009/10/23 Carlo snoobabk@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@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
-- Best regards, Igor Stasenko AKA sig. _______________________________________________ Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
2009/10/24 Chris Muller asqueaker@gmail.com:
Earlier this year, I had switched Magma over from requiring applications to #finalizeOids to registering with WeakArray. Apparently, I missed one! Thanks, I will fix that.
sig, I have not experienced any problems myself since making the above-mentioned change. There are no race conditions that I am aware of, can you elaborate about the problems you experienced?
I'm not sure.. it was long ago. Remember the guy who experienced the problems with getting his objects out-of-sync with db?
Apparently, the only problem which could occur, that when you in the middle of finalization, cleaning the dictionaries from obsolete entries, being interrupted with higher priority process which by touching the domain objects and triggers modifications to these dictionaries (like adding new oid's & dirty objects).
Thanks, Chris
On Fri, Oct 23, 2009 at 4:51 PM, Igor Stasenko siguctua@gmail.com wrote:
2009/10/23 Carlo snoobabk@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@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
-- Best regards, Igor Stasenko AKA sig. _______________________________________________ Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
Apparently, the only problem which could occur, that when you in the middle of finalization, cleaning the dictionaries from obsolete entries, being interrupted with higher priority process which by touching the domain objects and triggers modifications to these dictionaries (like adding new oid's & dirty objects).
Ok, that process runs at #userInterruptPriority (50). Unless the application is forking a process above that, it won't be able to agitate any proxies during finalization.
- Chris
magma@lists.squeakfoundation.org