From digit at sonic.net Mon Jun 8 18:28:43 2020 From: digit at sonic.net (Tim Johnson) Date: Mon, 08 Jun 2020 11:28:43 -0700 Subject: [Newbies] What happens if a Process is terminated inside of Process>>#terminate? Message-ID: <1e89bcbc216387d0a62f0b767e5d0ca6@sonic.net> 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 (?). Thanks, Tim J From marcel.taeumel at hpi.de Mon Jun 8 19:09:50 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Mon, 8 Jun 2020 21:09:50 +0200 Subject: [Newbies] What happens if a Process is terminated inside of Process>>#terminate? In-Reply-To: <1e89bcbc216387d0a62f0b767e5d0ca6@sonic.net> References: <1e89bcbc216387d0a62f0b767e5d0ca6@sonic.net> Message-ID: Hi Tim J,  as far as I know, every #basicNew: (primitive 71) triggers a GC. Not necessarily a full GC as through manually calling "Smalltalk garbageCollect", but at least an incremental GC. So, the image doing at least something (like the ticking clock in the upper right corner), will trigger a GC quite frequently. Best, Marcel Am 08.06.2020 20:28:53 schrieb Tim Johnson : 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 (?). Thanks, Tim J _______________________________________________ Beginners mailing list Beginners at lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcel.taeumel at hpi.de Mon Jun 8 19:11:09 2020 From: marcel.taeumel at hpi.de (Marcel Taeumel) Date: Mon, 8 Jun 2020 21:11:09 +0200 Subject: [Newbies] What happens if a Process is terminated inside of Process>>#terminate? In-Reply-To: References: <1e89bcbc216387d0a62f0b767e5d0ca6@sonic.net> Message-ID: ... maybe it is even every 100th (or n-th) time calling #basicNew:. Something like that. :-) Best, Marcel Am 08.06.2020 21:09:50 schrieb Marcel Taeumel : Hi Tim J,  as far as I know, every #basicNew: (primitive 71) triggers a GC. Not necessarily a full GC as through manually calling "Smalltalk garbageCollect", but at least an incremental GC. So, the image doing at least something (like the ticking clock in the upper right corner), will trigger a GC quite frequently. Best, Marcel Am 08.06.2020 20:28:53 schrieb Tim Johnson : 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 (?). Thanks, Tim J _______________________________________________ Beginners mailing list Beginners at lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: From kksubbu.ml at gmail.com Mon Jun 8 19:42:38 2020 From: kksubbu.ml at gmail.com (K K Subbu) Date: Tue, 9 Jun 2020 01:12:38 +0530 Subject: [Newbies] What happens if a Process is terminated inside of Process>>#terminate? In-Reply-To: <1e89bcbc216387d0a62f0b767e5d0ca6@sonic.net> References: <1e89bcbc216387d0a62f0b767e5d0ca6@sonic.net> Message-ID: <17993960-982e-5e5a-4b17-6239b264a9d8@gmail.com> On 08/06/20 11:58 pm, Tim Johnson wrote: > I do wonder why my image can go for 24 hours without something in the > image performing a garbage collection. garbage is collected only where VM's "free" memory runs low. See World Menu -> help -> vm statistics to see memory counts. In the same menu, you will also see "space left", which triggers garbage collection and then reports the free space. In Squeak, a "process" is just a chain of activation frames (contexts) tracking nested sends. This is the chain of contexts you see in Process browser (right pane) or in Debugger (top panel). HTH .. Subbu From mmille10 at comcast.net Tue Jun 9 03:56:02 2020 From: mmille10 at comcast.net (MARK MILLER) Date: Mon, 8 Jun 2020 21:56:02 -0600 (MDT) Subject: [Newbies] What happens if a Process is terminated inside of Process>>#terminate? In-Reply-To: <1e89bcbc216387d0a62f0b767e5d0ca6@sonic.net> References: <1e89bcbc216387d0a62f0b767e5d0ca6@sonic.net> Message-ID: <1704011024.252973.1591674962780@connect.xfinity.com> 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. ---Mark mmille10 at comcast.net > On June 8, 2020 at 12:28 PM Tim Johnson 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 (?). > > Thanks, > Tim J > _______________________________________________ > Beginners mailing list > Beginners at lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners