Newsgroups: comp.lang.smalltalk
From: hassnain.malik@cressoft.com.pk (Hassnain Waheed Malik)
Subject: Re: How to destroy objects in VW2.0
Date: Wed, 2 Oct 1996 09:43:48 LOCAL
Message-ID: <hassnain.malik.1.003C8AEF@cressoft.com.pk>
Lines: 59
References: <32427E02.30C8@diapool.informatik.uni-stuttgart.de> <3242E006.2242@concentric.net> <324692F6.284797A9@arscorp.com>
Organization: CresSoft
X-Newsreader: Trumpet for Windows [Version 1.0 Rev B.7]
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!news-peer.gsl.net!news.gsl.net!hunter.premier.net!news.mathworks.com!enews.sgi.com!news-feed.inet.tele.dk!clio.trends.ca!ki.net!sussi.cressoft.com.pk!cressoft.com.pk!hassnain.malik

In article <32427E02.30C8@diapool.informatik.uni-stuttgart.de> Klaus Meucht <meucht@diapool.informatik.uni-stuttgart.de> writes:
>From: Klaus Meucht <meucht@diapool.informatik.uni-stuttgart.de>
>Subject: How to destroy objects in VW2.0
>Date: Fri, 20 Sep 1996 13:20:34 +0200

>Hello,

>Can I explicitly destroy an Object in Smalltalk (specially VisualWorks
>2.0), without using the Garbage Collection ?

>What can I do, to get sure that the Smalltalk-system will destroy an 
>Object by the next Garbage Collection? It seems the solution
>to break all Dependents with the method 'release' is not enough.

>Is there another way, as to put all values of instance- and class
>variables to nil and after this starting the Garbage Collection ?

>My best regards
>Klaus

>-- 
>Klaus Meucht

>Allmandring 26 c
>70569 Stuttgart

>E-Mail: meucht@diapool.informatik.uni-stuttgart.de


Hello
What Alan and Dan says is true,  but DependentsFields holds  unnecessay 
information which cause increasing the  size of image . In Smalltalk two objects 
are very important ObjectMemory and ExternalDatabaseConnection. An instance of 
ObjectMemory represents a snapshot of object memory as it existed when that 
instance was created. The information contained in the object can be used to 
guide policy decisions for managing object memory. ObjectMemory holds all the 
instances of your application.  The global garbage collector is a 
mark-end-sweep garbage collector that is identical to the compacting garbage 
collector except that it marks and seeps all of the memory that is managed by 
the OE, including PermSpace. This garbage collector is never invoked directly 
by the OE, since the duration of its operation could be disruptive to the 
Smalltalk system .So when you have done your work and want to exit the 
application (VisualWorks)try this code, it will remove all unnecessary 
information (instance of your application) then start garbage collection.

(Object dependentsFields keys 
   do: [:each | ((each ~=ObjectMemory) 
             and: [each ~=ExternalDatabaseConnection]) 		         
                  ifTrue: [Object dependentsFields removeKey:  each]]).


**************************************************************************
                          Smalltalk Passion Of Life
                          *************************
Hassnain Waheed                                  hassnain@usa.net
Smalltalk Developer                          ilu@hasnain.brain.net.pk
                                          hassnain.malik@cressoft.com.pk
Feet small?  Nose runs?  Hey -- you're upside down!
**************************************************************************						
