[squeak-dev] Releasing objects from memory

tim Rowledge tim at rowledge.org
Sat Dec 17 18:21:56 UTC 2022


Some other object - perhaps a collection you have been adding your HWEntitys to? - is still holding onto them. And some other object is holding onto that possible collection, etc. Somewhere something that is effectively a global is pointing to them.

Sending an object #release does nothing special; it's just a method that breaks any dependencies *on it* that you might have caused as part of building UI components etc. You can override it to explicitly kill any references to objects you no longer want within your own classes. 

You need to find the object that *owns* your HWEntitys. The first place to look is in your code to see what you are doing with the HWEntitys that you create. Are you adding them to a list, for example? Building a tree structure of them, with one class variable pointing to the root? Do you have a debugger window open somewhere that is holding onto a long-forgotten context where you had kept the result of HWEntity allSubInstances ?

> On 2022-12-17, at 2:41 AM, Christopher Becker <cb627hf at gmail.com> wrote:
> 
> Hi all!
>  
> I have an Image file that is now about 345 MB in size but should be closer to 60 MB. The Image is growing in size day by day. When I do the following I get a seemingly never-ending list of objects in the Transcript:
>  
> HWEntity allSubInstances do: [ :hwe | Transcript show: hwe; cr. ].
>  
> I tried doing the following to release the objects from memory but the above still displays the objects:
>  
> HWEntity allSubInstances do: [ :hwe | hwe release. ].
>  
> Is there anything else I can do to free up memory?
>  
> Thanks in advance,
>  
> Chris Becker
>  
>  
> Sent from Mail for Windows


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Oxymorons: Sweet sorrow




More information about the Squeak-dev mailing list