MC working for managing the image

Bert Freudenberg bert at
Wed Oct 5 12:41:13 UTC 2005

Am 05.10.2005 um 14:07 schrieb Marcus Denker:
> It could be that someting is wrong with the cleaning... I just did  
> a flush in
> my newly build work-image and it said: "3 versions flushed, 344bytes
> reclaimed", That looks strange.

Well, the output is not too accurate - it just does a full GC,  
remembers the free space, then does a full GC again and reports the  

     | beforeBytes afterBytes beforeVersions afterVersions |
     Cursor wait showWhile: [
         beforeBytes := Smalltalk garbageCollect.
         beforeVersions := MCVersion allSubInstances size.
         MCFileBasedRepository flushAllCaches.
         afterBytes := Smalltalk garbageCollect.
         afterVersions := MCVersion allSubInstances size.
     ^self inform: (beforeVersions - afterVersions) asString, '  
versions flushed', String cr,
          (afterBytes - beforeBytes) asStringWithCommas, ' bytes  

If the total memory was shrunken by the second GC then the report  
would be way off.

You could try these:

     MCVersion allSubInstances size
     MCDefinition allSubInstances size
     MCPatchOperation allSubInstances size

which should all report 0 after flushing.

- Bert -

More information about the Packages mailing list