The Garbage Collection Handbook: The Art of Automatic Memory Management

The Garbage Collection Handbook: The Art of Automatic Memory Management

The Garbage Collection Handbook: The Art of Automatic Memory Management

The Garbage Collection Handbook: The Art of Automatic Memory Management

Excerpt

Happy anniversary! As we near completion of this book it is also the 50th anniversary of the first papers on automatic dynamic memory management, or garbage collection, written by McCarthy and Collins in 1960. Garbage collection was born in the Lisp programming language. By a curious coincidence, we started writing on the tenth anniversary of the first International Symposium on Memory Management, held in October 1998, almost exactly 40 years after the implementation of Lisp started in 1958. McCarthy [1978] recollects that the first online demonstration was to an mit Industrial Liaison Symposium. It was important to make a good impression but unfortunately, mid-way through the demonstration, the ibm 704 exhausted (all of!) its 32k words of memory — McCarthy’s team had omitted to refresh the Lisp core image from a previous rehearsal — and its Flexowriter printed, at ten characters per second,

The garbage collector has been called. some interesting statistics are as FOLLOWS:

And so on at great length, taking all the time remaining for the demonstration. McCarthy and the audience collapsed in laughter. Fifty years on, garbage collection is no joke but an essential component of modern programming language implementations. Indeed, Visual Basic (introduced in 1991) is probably the only widely used language developed since 1990 not to adopt automatic memory management, but even its modern incarnation, vb.NET (2002), relies on the garbage collector in Microsoft’s Common Language Runtime.

The advantages that garbage collected languages offer to software development are legion. It eliminates whole classes of bugs, such as attempting to follow dangling pointers that still refer to memory that has been reclaimed or worse, reused in another context. It is no longer possible to free memory that has already been freed. It reduces the chances of programs leaking memory, although it cannot cure all errors of this kind. It greatly simplifies the construction and use of concurrent data structures [Herlihy and Shavit, 2008]. Above all, the abstraction offered by garbage collection provides for better software engineering practice. It simplifies user interfaces and leads to code that is easier to understand and to maintain, and hence more reliable. By removing memory management worries from interfaces, it leads to code that is easier to reuse.

The memory management field has developed at an ever increasing rate in recent years, in terms of both software and hardware. in 1996, a typical Intel Pentium processor had a clock speed of 120 MHz although high-end workstations based on Digital’s Alpha chips . . .

Search by... Author
Show... All Results Primary Sources Peer-reviewed

Oops!

An unknown error has occurred. Please click the button below to reload the page. If the problem persists, please try again in a little while.