[Cuis-dev] [DEFECT] Debugger leaves terminated processes

Jaromir Matas mail at jaromir.net
Thu Oct 20 16:56:38 PDT 2022


Hi Juan, Gerald,

I've just tried Gerald's sequence on a clean image too and it runs as expected, indeed:

Simple fork
0
0
Handled exception
0
Debugger creation
0
100
100
Debugger close
106
106
Garbage collect   "Note: I ran an extra GC at the end to clear all processes"
0
0

But then I just played erratically with opening and closing debuggers and three UI's got "stuck" after a short while: now I can't get rid of them, all terminated but referenced from somewhere, thus won't be GC'd.

a Process terminated 40 (3081490) Formerly: Morphic UI
a Process terminated 40 (20413) Formerly: Morphic UI
a Process terminated 39 (3343717) Formerly: Morphic UI

Then I ran Gerald's sequence again and it worked as expected again, clearing (GC) all terminated processes - except the old "stuck" ones, indeed...

My question is how to "unreference" a terminated process to make it garbage collectable?

I guess I can find all terminated processes like this:
( Process allSubInstances select: [ :process | process isTerminated ] ) explore

and explore all places it's referenced from like this:
( Object allSubInstances select: [:obj | obj pointsTo: (self at: 1)] ) explore

but that doesn't help me understand WHY they're still being referenced from all those places after termination and how to remove those references...

I not even sure my question makes good sense, really... Any help understanding it would be greatly appreciated :)

Best,
Jaromir





From: Juan Vuletich<mailto:juan at cuis.st>
Sent: Friday, October 21, 2022 0:21
To: Discussion of Cuis Smalltalk<mailto:cuis-dev at lists.cuis.st>
Cc: Gerald Klix<mailto:cuis.01 at klix.ch>; Jaromir Matas<mailto:mail at jaromir.net>
Subject: Re: [Cuis-dev] [DEFECT] Debugger leaves terminated processes

On 10/20/2022 1:20 PM, Gerald Klix via Cuis-dev wrote:
> Hi all, Hi Juan,
>
> I think I found the cause of my huge images:
> The Debugger (or process termination)
> leaves terminated processes hanging around.
>
> First I saved the image before running the
> killer-Block (see the attached killit.st):
>
> -- snip --
> beforeLargeStack.image
> -rw-rw-r-- 1 bear bear 27M Okt 20 17:50
> Haver6.0-5496-beforeLargeStack.image
> -- snap --
>
> Than I ran killit and simply closed the debugger window
> and saved the image:
>
> -- snip --
> -rw-rw-r-- 1 bear bear 1.9G Okt 20 17:51
> Haver6.0-5496-afterLargeStack.image
> -- snap --
>
> From 27 megabytes to 1.9 gigabytes in 20 seconds,
> that's quite a feature, albeit a bad one.
>
> When I print all existing processes -- see diagnoseKillit.st -- I
> could see there are a lot of terminated processes hanging around.
>
> I did `self break` and closed the debugger: More terminated processes.
> Bad enough: `Smalltalk garbageCollect` does not help.
>
> The first part of RunningProcesses.txt is the transcript
> output after running the killer-block.
> (There are already some terminated processes, because I used
> image to implement the fixes, I just posted).
> The second part is transcript output after one `self break`;
> I didn't check exactly, but there are more terminated processes.
>
>
> Best Regards,
>
> Gerald

I just tried on a fresh Cuis.
1) Evaluated your killer 10M
2) waited for it to finish
3) closed the debugger.
4) 2 terminated processes.
5) Smalltalk garbageCollect
6) no terminated processes.

Looks ok to me.

--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20221020/dba020d0/attachment-0001.htm>


More information about the Cuis-dev mailing list