[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] OOP leaking with registered object
From: |
Roland Plüss |
Subject: |
Re: [Help-smalltalk] OOP leaking with registered object |
Date: |
Wed, 08 Apr 2015 13:36:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 04/07/2015 07:22 PM, Holger Hans Peter Freyther wrote:
> On Tue, Apr 07, 2015 at 06:18:13PM +0200, Roland Plüss wrote:
>
>> I'm using a similar trick in my own scripting language. Hoped I can get
>> away in Smalltalk without it. It's certainly a working solution albeit
>> not the most good one. Should do the trick for the time being.
> Okay, what else do you think the VM can do? E.g. if I would
> implement a "shutdown" command I would suspend all processes,
> then run the global collection, then look at gcArray iterate
> over them to call mourn.
>
> "Stop the normal handling"
> proc := (Process allInstances select: [:each |
> each name = 'finalization listener']) first suspend
>
> "Check if other finalizers run or wait..This runs the risk if
> new garbage is produced.. the vm will be upset and aborts.."
> [(Process allInstances select: [:each | each name = 'finalization worker'])
> isEmpty]
> whileFalse: [Processor yield]
>
>
> "Run GC which will signal finalization.."
> ObjectMemory globalGarbageCollect
>
> "Take the to be finalized array and mourn"
> garbage := Processor instVarNamed: #gcArray
> garbage ifNotNil: [garbage do: [:each | each mourn]]
>
>
> Specially step 1 and 2 is a bit dangerous. You should suspend
> other processes/work too to prevent from more GC to be produced.
This is indeed a problem I've seen already too. But how does Squeak for
example go about it? It does properly work with shutting down and
finalizing objects when the VM goes out. What do they do to solve the
problem?
--
Mit freundlichen Grüssen
Plüss Roland
Leader und Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php )
- Sowie verschiedene Blender Export-Skripts und Game-Tools
signature.asc
Description: OpenPGP digital signature
- [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/03
- Re: [Help-smalltalk] OOP leaking with registered object, Paolo Bonzini, 2015/04/03
- Re: [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/03
- Re: [Help-smalltalk] OOP leaking with registered object, Holger Hans Peter Freyther, 2015/04/04
- Re: [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/04
- Re: [Help-smalltalk] OOP leaking with registered object, Holger Hans Peter Freyther, 2015/04/05
- Re: [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/05
- Re: [Help-smalltalk] OOP leaking with registered object, Holger Hans Peter Freyther, 2015/04/06
- Re: [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/07
- Re: [Help-smalltalk] OOP leaking with registered object, Holger Hans Peter Freyther, 2015/04/07
- Re: [Help-smalltalk] OOP leaking with registered object,
Roland Plüss <=
- Re: [Help-smalltalk] OOP leaking with registered object, Paolo Bonzini, 2015/04/08