Browse Prior Art Database

Improved Garbage Collection in Java Programming Language

IP.com Disclosure Number: IPCOM000118870D
Original Publication Date: 1997-Aug-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 1 page(s) / 43K

Publishing Venue

IBM

Related People

Johnson, A: AUTHOR

Abstract

Garbage collection in the Java* programming language environment requires the system to stop all threads before garbage collection can proceed. This is required to stop other threads interfering with the garbage collection process, which can move objects in storage, and to capture data held in machine registers of a thread's context, which may be the only references to an object, and such references are needed by garbage collection.

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

Improved Garbage Collection in Java Programming Language

      Garbage collection in the Java* programming language
environment requires the system to stop all threads before garbage
collection can proceed.  This is required to stop other threads
interfering with the garbage collection process, which can move
objects in storage, and to capture data held in machine registers of
a thread's  context, which may be the only references to an object,
and such references are needed by garbage collection.

      Doing a hard suspend of all threads causes problems if the
threads are in the middle of a section of code holding a lock on a
resource, which can cause deadlocks to the garbage collection
process.  Deadlocks on 'C' runtime locks are one example of a common
cause of problems.

      Doing a cooperative suspend requires each thread to
periodically check if garbage collection is about to take place, so
the thread can do a controlled suspend.  Some calls to the operating
system or other subsystems (e.g., Transmission Control
Protocol/Internet Protocol (TCP/IP), file system) are difficult to
interrupt part of the  way through a blocking call, so it can suspend
garbage collection for the  duration of the call.

      The described solution records the fact that a thread is about
to make a blocking call but is in a state where it will not interfere
with garbage collection.  If a garbage collection or other request to
suspend a thread arrives, then the thread...