Image Bloat: What can I do about it.

Maloney johnm at wdi.disney.com
Mon Feb 9 16:15:27 UTC 1998


Re:
>>b. Workspace variables may be holding onto large objects.
>>Solution: For each existing Workspace window, create a new
>>one, copy the text of the old one into it, and close the
>>old workspace.
>
>This also happened to me when I was working in an adpcm coder... I had to 
>load .wav files on the image to compress them, and space left went down to 
>3mb. After assigning nil to all names in the workspace I was working on, space 
>left was still in 3mb. I closed the workspace and got back 10mb of memory...
>
>I haven't been able to reproduce that state.

When you evaluate an expression in a workspace, then any undeclared
variables in that expression are automatically declared to be workspace
variables. (Unless they start with a capital letter.) Each workspace
keeps these bindings in its own private dictionary until you close
the workspace. Yes, assigning nil to the variables you know about
will free the space they hold onto. But there may be some variables
that you used and since forgot about. The trick of copying the
text into a new workspace and closing the old ensures that all
the local variables of the old workspace are released.

	-- John





More information about the Squeak-dev mailing list