[Vm-dev] Garbage collector issue

Pavel Krivanek pavel.krivanek at gmail.com
Thu Jan 26 13:38:01 UTC 2017


in Pharo and in Squeak, if you try to print:

Point allInstances size.

several times, you will get fastly growing number of Point instances in
most cases. But when you do:

Smalltalk garbageCollect. Point allInstances size.

The number of instances is quite stable.

I realized that about every 5 milliseconds two new Point instances are
created and not collected in reasonable time. I tried to find what points
to them and I realized that nothing. That two instances contain display
size so it was easy to find the place where these points are created. In
Pharo it is in


"Check whether the screen size has changed and if so take appropriate

Display extent = DisplayScreen actualScreenSize ifTrue: [^ Display].
DisplayScreen startUp.
World restoreMorphicDisplay.

As you can see in the code, the two point instances are only very temporary
objects. And with some experiments I realized that that behavior is not
Point specific (eg. some problem with the @ primitive). Because if you
replace the code of the method with only Object basicNew, the growth of
Object instances is similar. See the attached script.

pharo-ui Pharo st script2.st

-- Pavel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170126/82c36855/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: script2.st
Type: application/octet-stream
Size: 773 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170126/82c36855/attachment.obj>

More information about the Vm-dev mailing list