Browse Prior Art Database

Prioritization of Smalltalk Garbage Collection Based on System Activity

IP.com Disclosure Number: IPCOM000111774D
Original Publication Date: 1994-Mar-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 100K

Publishing Venue

IBM

Related People

Eisen, IR: AUTHOR [+2]

Abstract

Garbage collection occurs randomly in Smalltalk* and can occur at a time when the user does not prefer to have it occur. A method is needed to start garbage collection based on system activity.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Prioritization of Smalltalk Garbage Collection Based on System Activity

      Garbage collection occurs randomly in Smalltalk* and can occur
at a time when the user does not prefer to have it occur.  A method
is needed to start garbage collection based on system activity.

      This article describes a technique for selective invocation of
the Smalltalk garbage collection mechanism to avoid having a long
(20-30-second) garbage collection at a time that the user does not
desire.  If the user is performing a task, a garbage collection can
render the user helpless while the system performs the routine.  When
the garbage collection takes a long time (typically, 20-30 seconds),
this can have an adverse effect on the user's productivity as well as
the system's performance.  Also, when garbage collections are spaced
too far apart in time, the system's performance slowly degrades
between each garbage collection.

      A technique for improving this mechanism is built on the
concept that garbage collection should occur more frequently and at a
time when the user would be least interrupted by the process.  The
developer of the application cannot always know when the best time
for a garbage collection should occur.  One fail safe way would be
for garbage collection to occur when the system is idle - that is,
there is no other activity taking place in the system.  Currently
there is no mechanism for determining if the system is idle and
invoking Smalltalk's garbage collection routine in response to this
idle condition.

      A solution to this problem is the development of a program that
measures system activity and then notifies Smalltalk that a garbage
collection should occur.

      This program would use a special technique to determine system
activity.  Since there is not a direct way of asking the system "How
busy are you?" the program would have to determine based on the
amount of processing time it was given by the system.  At start up,
the program would set itself to the highest priority available in the
system.  It would then go into a loop and count the number of times
it processed the loop in a given number of milliseconds.  This number
of milliseconds would be equal to the number in a time splice in the
given system.  This result counter is the highest number of loops the
program can process in a time slice when the program has the complete
system processor available to it.

      The program would then set itself to the lowest priority in the
system.  Now, the program will only be able to run when other
applications are idle.  Any other program will have priority over
this program. ...