Michel,
As mentioned on the other ongoing thread about Strings objects, Strings are not uniquely stored in Smalltalk, thus, when you inspect an object (and, therefore, send it a #printString message) new instances of String are going to be created.
There are, obviously some peculiarities involved here (probably something related to how the inspector is implemented, because you are not copying every instance (just 20,000 of them) on each inspect).
If you wait a while, these objects are going to be garbage collected so, besides the extra memory needed to open the inspector on such a large collection no harm is done. 120,000 ByteStrings is a lot... I can't think of what you would gain from inspecting this collection, I mean, you can't possibly go through them all to validate some logic (ok, ok, this is no excuse).
Try forcing a garbage collection between two inspects....
One more thing: I would not recommend you to use the returned value of "ByteString allInstances" in your business logic... I hope the reason for that is clear enough
Hope it helps,
Ricardo
On 8/24/06, Michel Dufour <[hidden email]> wrote:
Hi,
When a just open a Inspector windows of String objects the quantity of
instance increase by the same number of objects that I have in my
inspector. Is that normal?
Example:
0. ByteString allInstances size ---> 80,000
1. TEST := Tools bossLoad: 'bossInfra18585397.bos'. --- loading 20,000 strings
2. ByteString allInstances size ---> 100,000
3. TEST inspect
4. ByteString allInstances size ---> 120,000
If I redo step 3 again I got 140,000, I have a 5i1 VW image.
Michel