A Generational, Compacting Garbage Collector for C++

نویسنده

  • Joel F. Bartlett
چکیده

One of the most striking differences between any Lisp dialect and C++ is not the obvious syntax differences, but rather their opposing views on management of objects with indefinite extent. While Lisp systems automatically recover storage used by objects that are no longer needed by the program, C++ requires that the user explicitly delete the object in order to reclaim storage. Automatically maintaining reference counts by operator overloading is one method that has been suggested for hiding storage management operations inside a class. An alternative is to use a garbage collector. Using the "mostly-copying" garbage collection algorithm described in this paper, a garbage collector has been constructed for C++. Its use requires no modifications to the C++ compiler or runtime environment. In addition, it is far simpler to define a garbage collected class than to define methods to reference count the class. Experience to date shows that the performance of this garbage collector is better than other methods of automatic storage management and comparable to explicit allocation and deletion.

منابع مشابه

Combining Single-Space and Two-Space Compacting Garbage Collectors

The garbage collector presented in this paper makes use of two well known compaction garbage collection algorithms with very diierent performance characteristics: Cheney's two-space copying collector and Jon-ker's single-space sliding compaction collector. We propose a scheme which allows either collector to be used. The run-time memory requirements of the program being executed are used to det...

متن کامل

A Compacting Garbage Collector for Unidirectional Heaps

A unidirectional heap is a heap where all pointers go in one direction, e.g. from newer to older objects. For a strict functional language, such as Erlang, the heap may be arranged so that it is unidirectional. We here present a compacting garbage collection algorithm which utilizes the fact that a heap is unidirectional. Only one memory space is used in our algorithm. In fact, no extra memory ...

متن کامل

A Compacting Garbage Collector for Erlang

By utilising the fact that all data in the heap in an Erlang implementation may be arranged so that all pointers go towards earlier allocated objects, a compacting garbage collection algorithm has been designed. In contrast to a copying garbage collection algorithm, only one memory space is used. In fact, no extra memory is used at all, not even any reserved bits within the cells. The algorithm...

متن کامل

Generational Garbage Collection for Lazy Functional Languages without Temporary Space Leaks

Generational garbage collection is an established method for creating eecient garbage collectors. Even a simple implementation where all nodes that survive one garbage collection are tenured, i.e., moved to an old generation, works well in strict languages. In a lazy language, however, such an implementation can create severe temporary space leaks. The temporary space leaks appear in programs t...

متن کامل

Generational Garbage Collection without Temporary Space Leaks for Lazy Functional Languages

Generational garbage collection is an established method for creating eecient garbage collectors. Even a simple implementation where all nodes that survive one garbage collection are tenured, i.e., moved to an old generation , works well in strict languages. In lazy languages, however, such an implementation can create severe temporary space leaks. The temporary space leaks appear in programs t...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

متن کامل
عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1990