Garbage collects a specific object
Is it possible to garbage collect a specific object in Pharo?
eg. I know that a certain object is not (should not) be referenced by any other object. And it takes up a lot of space. Does it make sense to just run general garbage collection on the system? Or it is possible to remove from the heap only a specific object / tree
source to share
Smalltalk garbage collectors cannot collect garbage for just one object.
There are two main methods used: cleanup generation and marking and sweeping. Generation scrapping works on new and relatively new objects by copying used objects to another unused space and ignoring all garbage. Objects that are copied many times are moved to "old space". Old space is garbage collected with a mark and sweep algorithm. This algorithm traverses all Smalltalk objects and marks them as "untagged". Then it goes through all the available objects and marks them as "marked". In the final scan, anything that is marked as "unmarked" is released.
It is not possible to run any algorithm on one object.
source to share