do I have to garbageCollect every time I create a large object?

Tim Rowledge tim at sumeru.stanford.edu
Thu Aug 9 17:27:13 UTC 2001


There are plenty of ways to arrange memory and garbage collection to
alter the effect of large objects; obviously they will have an effect on
other parts of the system. At the most trivual level, if you implement
a separate space for large objects (a relatively common case in most of
the commercial Smalltalks) you have a more complex problem when tracking
inter-space pointers. You also have more of a problem when growing your
spaces, working out how much is free (if you have 1Mb in space A, 400kb
in space B and 25kb in space C, does that mean you can allocate a
1.425Mb object? Doubt it...) and so on.

My experience is that it can often be worth the trouble of having a
space exclusively for large non-pointer objects such as big bitmaps etc.
You don't have to scan these for tracing purposes in gcs and that makes
life much simpler.

Of course, another approach is to avoid allocating huge monolithic
objects. If you look at your needs it's going to be pretty rare that you
actually need one.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
The whole is the sum of its parts, plus one or more bugs





More information about the Squeak-dev mailing list