Hang while commiting objects with attribute as MagmaCollection+index

Chris Muller asqueaker at gmail.com
Fri Jan 4 19:32:22 UTC 2008


>                                         IFIModels users add: user].

Well, there you go.  Isn't this referencing the entire, ever-growing
database all in memory?

"You gotta let go, Luke."  ;-)

Having said that, I am still experiencing some difficulty with memory
"leaks" myself due to old stale MethodContexts not letting go of
various references.  It seems to be more of a Squeak problem that I
don't fully understand yet.

> Now I am wondering if creating empty indexed Magma collection could be a
> problem or should the collection be populated first?

No, either way should be no problem, and the test cases cover all the
combinations IIRC.  Look at #testMajorFunctions and
#testAddIndexAndObjectsSimultaneously.

 - Chris



On Jan 4, 2008 1:00 PM, Hilaire Fernandes <hilaire at ofset.org> wrote:
> I was wondering if the index should only be created after the collection
> is in the database. So I changed the test, with two commit: blocks and
> the learner object's magma collections and indexes created at the second
> commit.
>
> testAddLearner
>         | user |
>         100 timesRepeat:
>                         [
>                         IFIDbSession commit:
>                                         [user := IFILearner new.
>                                         IFIModels users add: user].
>                         IFIDbSession commit: [user initLearningStates ;
> initPedagogicalMoments ]].
>         self assert: IFIMagmaResource current school learners size = 100
>
>
> But the result is the same.
>
> Now I am wondering if creating empty indexed Magma collection could be a
> problem or should the collection be populated first?
>
> Hilaire
>
> Hilaire Fernandes a écrit :
>
> > While writing test I met the following problem:
> > I want to add hundred of (learner) object in a users MagmaCollection (it
> > is located in a branch of the DB and it has index too)
> >
> > While looping, the commit becomes slower and slower until Squeak stall
> > at the 90th iteration. I know I can move the commit: in the outer block,
> > it is faster but still hang at the final commit time. The mouse icon is
> > then stuck to the write icon and the Squeak has to be brutally stopped.
> >
> > In the Learner initialization if I remove the addIndex:, the process run
> > at a constant speed and finish.
> > It looks like a problem related to index creation.
> >
> > testAddLearner
> > | user |
> > 100 timesRepeat:
> >    [user := IFILearner new.
> >     IFIDbSession commit:
> >     [IFIModels users add: user
> >     "IFIMagmaResource current school addPerson: user"]]
> > self assert: IFIMagmaResource current school learners size = 100
> >
> >
> > IFILearner>>initialize
> >     super initialize.
> >     schoolYear := #CE2.
> >     learningStates := MagmaCollection new.
> >     learningStates
> >         "addIndex: (MaCompetencyIndex attribute: #competency);"
> >         addIndex: (MaFloatIndex attribute: #acquisitionLevel)
>
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>


More information about the Magma mailing list