>>
>> I would like to compute the really used memory.
>>
>> thanks
>>
>> mariano
>>
>>>
>>> At the beginning I also thought to have 4, instead of 0. The problem is that if you put 4 and you have an object with and instVar that it is a SmallInteger, it will be counted twice, when actually it is only one.
>>> That's why I thoguht 0 was better, since I want the really occupated memory. On the other hand, if you do "4 sizeInMemory" and see zero, I have to admit it is a litlte confusing.
>>>
>>> The problem is that if I do for example:
>>>
>>> Class >> spaceForInstances
>>> | totalSize |
>>> totalSize := 0.
>>> self allInstancesDo: [ :inst |
>>> totalSize := totalSize + inst sizeInMemory.
>>> ].
>>> ^ totalSize
>>>
>>> SmallInteger spaceForInstances ->> 0
>>>
>>> So I don't know...maybe we have to answer 4 instead of 0?
>>>
>>> Adrian what do you think?
>>>
>>>> >
>>>> > - In the line contentBytes := contentBytes + (self basicSize * bytesPerElement), why is contentBytes added because it should be always 0 because self class instSize should return 0 in case of variable classes. Or do I miss something?
>>>> You can have instance variables in variable classes:
>>>>
>>>> ArrayedCollection variableSubclass: #TallyArray
>>>> instanceVariableNames: 'tally'
>>>> classVariableNames: ''
>>>> poolDictionaries: ''
>>>> category: 'Collections-Arrayed'
>>>>
>>>> TallyArray instSize 1
>>>> (TallyArray new: 5) basicSize 5
>>>>
>>>> Sure, they're not used very often in Squeak/Pharo since become: is so slow, but there's no theoretical reason why you can't for example implement Set as a variable subclass with a tally inst var.
>>>>
>>>> >
>>>> > - Please remove the inline comment "inst vars"; if a comment is needed it should go into the main comment.
>>>> I agree, should be self-explanatory.
>>>>
>>>> Cheers,
>>>> Henry
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>>
Pharo-project@lists.gforge.inria.fr
>>>>
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>
>
>