On Wed, Sep 22, 2010 at 12:12 PM, Henrik Johansen <[hidden email]> wrote:
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?
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Henrik Sperre Johansen
On Sep 22, 2010, at 12:12 , Henrik Johansen wrote:
>> - 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: Yes, of course; I forgot this case. Adrian _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Mariano Martinez Peck
On Wed, Sep 22, 2010 at 12:34 PM, Mariano Martinez Peck <[hidden email]> wrote:
So....what should we consider for SmallInteger ? 4 bytes or 0 bytes? I would like to compute the really used memory. thanks mariano
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Ok...I have just commited. If you want to review:
http://code.google.com/p/pharo/issues/detail?id=3032 cheers Mariano
On Tue, Sep 28, 2010 at 1:45 PM, Mariano Martinez Peck <[hidden email]> wrote:
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |