[Newbies] What happens if a Process is terminated inside of Process>>#terminate?
mmille10 at comcast.net
Tue Jun 9 03:56:02 UTC 2020
Re. garbage collection
The description of the GC from the book, "Squeak: Open Personal Computing and Multimedia" might help with your question. It's from the chapter "A Tour of the Squeak Object Engine," written by Tim Rowledge:
"Squeak uses an interesting hybrid of generation scavenging and mark-sweep collection as its garbage collector. Once the image is loaded into memory the end address of the last object is used as a boundary mark to separate two generations [old and new].
When the remaining free memory runs low, or a preset number of objects have been allocated, the VM will pause to garbage collect the new object region (ObjectMemory>>IncrementalGC). This is done with a mark-sweep algorithm modified to trace only those objects in the new region, thus touching considerably less memory than an entire image sweep. ...
[The] use of the two generations means that it can typically run in a very short time ... During activities like typing or browsing and coding, the system will run an incremental garbage collect one to five times per second. ...
One limitation of an incremental collection is that any objects from the old region that are no longer referenced do not get freed and collected. Of course, the observation that lead to generation scavenging tells us that this usually doesn't matter since old objects generally continue to live. However, sometimes we do need to completely clean out the object memory. ... Squeak simply forces the system to believe that the old/new boundary is at the bottom of the old region. Thus, the entire image is now considered to be new objects, and all objects will be fully traced. Look at the ObjectMemory>>fullGC method for details."
In another part of the chapter he says the generation scavenger method is based on the idea that older objects will tend to not need to be collected, or if they do, it's not that often. Some old objects will hang around forever, because something is always referencing them. However, newer objects tend to have very short lives, and so will be collected most frequently.
mmille10 at comcast.net
> On June 8, 2020 at 12:28 PM Tim Johnson <digit at sonic.net> wrote:
> Hi newbies list,
> I wrote a little Morph to monitor live processes vs terminated
> processes. In doing so, while experimenting, I ended up with one
> Process which seemed to be terminated inside of Process>>#terminate,
> which I think is strange. Is it strange? I ended up discarding the
> working copy of my image and reverting to the last saved version.
> It is interesting to see how many terminated Processes are left behind
> when WebServer has been running for a long time. Luckily they all seem
> to be swept away with a #garbageCollect. I do wonder why my image can
> go for 24 hours without something in the image performing a garbage
> collection. SHTextStylerSH80 creates and terminates many processes
> also, but they seem to get collected without my intervention (?).
> Tim J
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
More information about the Beginners