Full garbage collection throughtout the system.

Stephen Pair spair at advantive.com
Wed Dec 12 20:23:12 UTC 2001


The socket situation is not nearly so bad as the file situation.  With
sockets, GC will only kick in if you have problems opening a socket,
which should only occur if you've exhausted system resources of one kind
or another.  In the case of files, you might fail to open a file for
writing because you've got got an existing Stream open on the same
file...this is much more easily encountered.

In the case of sockets, I'd say triggering GC is actually useful.  If
you're careful about managing socket resources, then you're likely to
never encounter a GC triggered by creating a socket.  If you're sloppy
about it, then the GC will kick in if you've exhausted socket related
resources and clean up those resources in bulk.  The tradeoff seems to
be one of latency vs. overhead.  The only issue might be if there is
some problem causing socket creation to fail that cannot be solved by a
GC (in which case GC would be invoked on every attempt at socket
creation).

Invoking GC when you fail to create a new socket is a good safety net.
For files, it's not so good because it happens not just on resource
exhaustion, but also on conflicting uses of the same file.

- Stephen





More information about the Squeak-dev mailing list