On Tue, Jan 7, 2014 at 11:40 AM, Chris Muller asqueaker@gmail.com wrote:
Don't forget there is no requirement to shrink an image along package boundaries. Did you try, for example, removing TestCase and all subclasses? That would cut across package boundaries but so what?
I left TestCase in place, but I did try removing all subclasses. That led to an emergency evaluator. :-)
How did you try removing all subclasses? I wasn't sure how the system would respond to removing a class with subclasses, so I removed leaf subclasses first, which worked the first time.
[(TestCase allSubclasses select: [ : each | each subclasses isEmpty ]) do: [ : each | each removeFromSystem: false ]. TestCase allSubclasses size > 0 ] whileTrue
It turns out I was mistaken. "Smalltalk unloadReloadablePackages" wasn't actually working, it bailed after the first few packages because it calls #fixObsoleteReferences after unloading a package, which raises an error if there are obsolete classes.
Now that I've got that sorted out, I can reliably shrink to a 11.3MB image using the attached script.
There's one oddity in that script. I had to patch SystemNavigation>>allObjectsDo:, because I was getting a #shouldNotImplement error from the SmallInteger implementation of #nextObject. Somehow, scanning the heap got to the end without encountering the sentinel object created at the top of #allObjectsDo:, and #nextObject answered 0. I'm not sure what to make of that.
Anyway, the script suggests a few fixes that should go into trunk before release.
Yes. Incidentally, sharing .st scripts through e-mail, Squeak can never seem to parse them when the attachment is downlaoded to another platform. I think because the email client treats it as "text" needing LE conversoins or something. Could you gzip your .st file and so it will be treated as binary, then I can look at it.
OR, if you want to put it into trunk I'll just see it there.
thanks!
Colin