[BUGFIX] [MAGMA] Image Grow [PIM] [DANGEROUS?]

Giovanni Giorgi jj at objectsroot.com
Tue Oct 21 17:39:25 UTC 2003


Hi Chris!
I have done a simple method to purge magma session.

Chris Muller wrote:
[...]

>Also, unfortunately, there is a known bug I haven't been able to figure out.  I
>think it might be a Squeak limitation but I'm not sure.  If you are familiar
>with the mechanics of MethodContexts and BlockContexts, perhaps you will have
>an easy answer!  First, this simple script demonstrates the problem:
>  
>
Hem....I am not so strong in MethodContexts ;(

>[...]
>Do you or anyone else know how to get hold of these MethodContexts
>programmatically?  If so, I can put this clean-up as part of the disconnect.
>
>I'm sorry this problem has affected you, I hope we can find a solution.
>  
>
Do not worry. I will find a solution ;) with my....personal way... ;)
[gio si prying the Squeak Gods....
    Alan&Dan Can we help us?!?!?]

I have done a small method:
====================================
purgeMagmaSessions
    | ms |
    "PIMDB purgeMagmaSessions"
    ms _ MagmaSession allInstances.
    Transcript cr; show: ms size asString.
    "First Step:"
    ms  do: [ : each | each become: String new ].
    "Second strong step:"
    ms _ MagmaSession allInstances.
    ms
        do: [:elem | elem isConnected
                ifFalse: [| objList |
                    objList _ Smalltalk pointersTo: elem.
                    objList
                        do: [:mc | mc class == MethodContext
                                ifTrue: [ mc receiver: nil. Transcript 
show:'#'.]
                                ifFalse: [ "Transcript cr; show: 
'Excluding:' , mc asString"]]]].
    Smalltalk garbageCollect.
    Transcript cr; show: ms size asString.
====================================
This method is very very crude and can lead problems because uses a very 
simple idea to work.
My image started with 114 magma sessions and ended up with 0 sessions !!!
You should wait a little and/or try it two times.
Can you review it and incorporate in the next magma release?

-- 
  [   [  [ JJ ]  ]   ]  | First, they ignore you. Then they laugh  
                        | at you. Then they fight you. Then you win
http://www.siforge.org  |          Mahatma Ghandi





More information about the Squeak-dev mailing list