[Vm-dev] Minifying Woes

Tom Beckmann tomjonabc at gmail.com
Fri Mar 24 15:53:19 UTC 2023


Hi list,

we're on a bit of an adventure to try and find the minimum size of a Squeak
image that can still run a stdio REPL. After narrowing it down to around
6MB, we noticed that SpaceTally reported ~3MB of objects (as opposed to the
6MB that were saved on-disk).

After a further deep-dive (in which SqueakJS and later the VM simulator
were of immense help), we found that there were 60 objects of class index
19, which took up 3MB of space in the .image file. After some digging, we
eventually found out that class index 19 are from
SpurMemoryManager>>sixtyFourBitLongsClassIndexPun. As we understand it the
"pun" objects are internal clones of the built-in classes (such as
WeakArray, Array, ...), to prevent them from being found by a user.

We even managed to locate one of the larger class-index=19 objects with the
help of Tom (WoC): the hiddenRootsObj contains in its 4099's slot the
RememberedSet, which in our image was just over 1MB in size.

Now, we're wondering whether we can get closer to our goal of getting to
the smallest possible on-disk image size (don't ask why, at this point it's
more of a challenge...). Does the RememberedSet need to be persisted or
could we (easily?) nil it before saving to disk? Are there other low
hanging fruits in terms of VM-internal objects that could be freed during
snapshot generation?

Best,
Jens (jl) and Tom (tobe)

PS: A not-so-clean version of the minification process can be found here
https://github.com/hpi-swa-lab/cloud-squeak
We're in the process of cleaning it up and might send out a proper
announcement once it's pretty.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20230324/ce88d067/attachment.html>


More information about the Vm-dev mailing list