Usman Bhatti wrote:
Hello,
I had a "Not enough memory" problem in my Moose image so digging the error
(with Jean-Baptiste) reveals that when there is an error in a glamour
browser, roassal visualization does not unsubscribe events. In my case, it
retained the browser objects in the memory because these were pointed to by
the subscriptions and this the browser was not releasing my MooseModel.
To reproduce the problem, you can execute the script below. On the right
pane, right click on any node and then do, "select in tree". Close browser,
garbage collect, and then do: MOAnnouncer allInstances. There are few
instances related to MOAnnouncer that exist in the memory. Without the
error, these objects disappear.
Can you please have a look?
tx,
Usman
| browser items |
browser := GLMTabulator withStatusbar.
items := 50.
browser column: #one; column: #two.
browser transmit to: #one; andShow: [ :a |
(a tree)
title: 'Tree';
showOnly: 30;
display: [:each | 1 to: items];
children: [ :item :x :level | level > 1
ifTrue: [ #() ]
ifFalse: [ 1 to: item ]]].
browser transmit to: #two; from: #one; andShow: [ :a |
a mondrian
title: 'Numbers in Mondrian list';
painting: [:view :number |
view interaction item: 'Select in tree' action: [:each | ((browser
paneNamed: #one) port:#selection) value:41 ].
view interaction on: ROMouseEnter do: [ :n | ].
view shape rectangle size: 10.
view nodes: (Collection withAllSubclasses).
view edgesFrom: #superclass.
view treeLayout.
]
].
browser openOn: 1
In my image running since Sept 2012, [ROAnnouncer allInstances] gives
10878 items.
In a freshly unzipped moose-suite-4_7-beta from 2013-01-03...
Initially [ROAnnouncer allInstances] gives 0 items, and [Announcer
allSubInstances] gives 8 items.
After running Roassal Tests, these give 1108 items and 1258 items.
After running Roassal Tests again, these give 2238 and 3073 items.
Closing TestRunner and [Smalltalk garbageCollect] do not reduce these
values.
What is the best way clear this out?
From Explorer when I use [PointerExplorer new openExplorerFor: self] on
one random ROAnnouncer instance, there are 24 objects holding a
reference to it - but I don't don where to go from there. An
interesting exercise would be using Roassal to graph the network
structure of instance dependencies, but that is a distraction I can't
afford at the moment.
btw, in the course of looking at this, I came across this interesting post
http://onsmalltalk.com/squeak-smalltalk-image-maintenance
It would be REAL NICE to have something like that as part of the
distribution under the System menu, which bought up a list of items with
checkboxes for cleanup tasks that could be run.
cheers -ben