[Newbies] Low space

Keith Hodges keith_hodges at yahoo.co.uk
Tue Jan 1 03:41:58 UTC 2008


Looking after your image is quite a skill, it takes time to learn how to
do it. It is also one of those things that we who have learnt that
skill, are not very good at explaining just how we do it.

Firstly, your critique of the IDE... I would say it really depends upon
which tools in the IDE you are using. If you were to start with the
basic tools, those which have been around for a long time, such as the
"PackagePaneBrowser", I think you would find things much better. I find
the Omnibrowser tools to be slow, especially since they have (or
certainly used to have) a major memory leak which made them unusable for me.

I have been attempting to encourage package developers to ensure that
their packages implement #freeSomeSpace and #cleanUp in order to make
this problem easier to solve. Here are some methods that you could add
to your image and run.
"this one is the main offender for the new UI tools memory leaking"

    ^ self invalidateCache
     ActionMaps := nil.

    Definitions := nil  

    self initialize

Undeclared removeUnreferencedKeys.
RequiredSelectors current ensureClean.
AppRegistry removeObsolete.

    self allSubInstancesDo: [ :each | each clearHandlers ].
    "system request for memory cleanup (e.g. prior to an image publication)"
    self flushAllCaches      
  (Smalltalk select: [ :class | class respondsTo: #cleanUp ]) do: [
:each | each cleanUp ].

So executing SmalltalkImage cleanUpAll. Should make a difference to your
memory footprint.

Is it really using 550Mb, that is a lot, it might have reserved that
much virutal memory address space with the OS, but really only be using
a fraction of that. My images are absolutely stuffed full of extras and
I manage to keep them down to around 40-50Mb. See how much diskspace it
uses when you save the image, that is the more realistic figure.

I hope this helps a bit



More information about the Beginners mailing list