[squeak-dev] MC scories in Object's DependentsFields

Bert Freudenberg bert at freudenbergs.de
Mon Jan 21 23:17:38 UTC 2013


On 21.01.2013, at 13:40, "H. Hirzel" <hannes.hirzel at gmail.com> wrote:

> And as we are at it
> 
>    http://bugs.squeak.org/view.php?id=7560
> 
> Monticello-Base contains the three classes
> 
> MCDefinition
> MCPackage
> MCSnapshots
> 
> All class comments are empty.

A definition is a model for Smalltalk code. A package snapshot is a collection of these definitions. 

> What is the relationship between MCPackage and PackageInfo.

MCPackage uses PackageInfo to find out which methods and classes belong to a package.

> What does
>   MCDefinition clearInstances.
> do?

It nils out the quick-access cache to its subinstances. #allInstances is very slow as it needs to scan the whole object memory, whereas retrieving an instance from the "instances" WeakSet is O(1).

> Why can this be done safely?

Because re-using a definition is only a space optimization.

> What is the impact of doing this?

When loading/creating another snapshot, the definitions that are in both snapshots will not be shared but occupy space twice.

- Bert -

> --Hannes
> 
> 
> On 1/21/13, Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com> wrote:
>> Trying to chasePointers of MCDefinition allSubInstances, I saw several
>> instances of MCPatchBrowser, MCVersionInspector, ...
>> Though no such window is opened in my World, what's up?
>> 
>> If I chase pointers of one of these ghost MCPatchBrowser keys, I see
>> nothing but the opened inspectors and ObjectDependentsFields...
>> 
>> I guess this must be exactly the same bug as
>> http://bugs.squeak.org/view.php?id=7119 (see my own comments).
>> The key of DependentsFields are weak, so they should be reclaimed.
>> But what if the value points somehow to the key (no matter how deep)?
>> Well, the key will never be reclaimed then.
>> 
>> I don't feel comfortable with these dependencies... It's a nest of
>> problems.
>> In MVC, the dependents were maintained in model, so a cycle would be
>> garbageCollected more easily...
>> 
>> Nicolas
>> 
>> 
> 



More information about the Squeak-dev mailing list