Thanks
A task of Pavel will be to see how slots usage can reduce that
space lost.
Hi Moose users,
as you may know, at Synectique we experiment lots of issues about memory usage.That's why i had a look at the number of unused instance variables in one of our system loaded with a big model from one of our main customer.
Total instance variables: 26.852.653
Used instance variables: 17.393.938Empty collections: 5.023.508Recoverable instance variables: 14.482.223
The recoverable instance variables are those with nil or an empty collection (or MultiValueLink)
As you can see, we can save a lot of memory :-)
Here is my (dirty) code to get that:
countUsedInstanceVariableInForSubInstances: aClass| usedInstNbr instNbr emptyCollNbr |usedInstNbr := 0.instNbr := 0.emptyCollNbr := 0.aClassallSubInstancesDo: [ :anEntity |instNbr := instNbr + anEntity class allInstVarNames size.anEntity class allInstVarNamesdoWithIndex: [ :e :i |(anEntity instVarAt: i)ifNotNil: [ :content |([content isEmpty.emptyCollNbr := emptyCollNbr + 1.false ]on: MessageNotUnderstooddo: [ false ])ifFalse: [ usedInstNbr := usedInstNbr + 1 ] ] ] ].^ {('Used instance variables' -> usedInstNbr).('empty collections' -> emptyCollNbr).('Recoverable instance variables' -> (instNbr - (usedInstNbr - emptyCollNbr))).('Total instance variables' -> instNbr)}--
Guillaume Larcheveque
_______________________________________________ Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev