Help! ByteString is out of control
Tom Phoenix
rootbeer at redcat.com
Mon Aug 29 21:50:01 UTC 2005
On 8/29/05, Jason Rogers <jacaetevha at fast-mail.org> wrote:
> Recently it started hanging. I have been able to run a SpaceTally on it
> and found that 33.1+MB are used for instances of ByteString. I haven't
> been able to track down all 99000+ instances,
I just checked my Squeak3.8-6665full.image, "right out of the box".
86301 instances of ByteString. So probably 86% of your ByteStrings are
there for good reasons. (Nearly everything that used to be a String is
now a ByteString, so it's a popular class.)
But it only takes one large instance to make a large image. This code,
to be executed in a Workspace, should give you your top culprits.
tops := SortedCollection sortBlock: [:a :b | a size > b size].
thresh := 10000.
ByteString allInstancesDo: [:s |
s size > thresh ifTrue: [
tops add: s.
[tops size > 10] whileTrue: [
thresh := tops last size.
tops remove: tops last. ]]].
tops asArray inspect.
--Tom Phoenix
More information about the Squeak-dev
mailing list
|