A garbage collection policy based on empirical behavior

  • Authors:
  • Woo Hyong Lee;J. Morris Chang

  • Affiliations:
  • Samsung Electronics Co., Gyeonggi-Do 442-742, South Korea;Department of Electrical and Computer Engineering, Iowa State University, 3216, Coover Hall, Ames, IO

  • Venue:
  • Information Sciences—Informatics and Computer Science: An International Journal
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many C++ studies show that dynamic memory management is one of the most expensive components in many software systems. C++ programs tend to carry out object creation and deletion prolifically. As a result, dynamic memory management can consume up to 30% of the program execution time in C++. In many cases, programmers need automatic dynamic memory management to free them from the problem of having to manage the C++'s large number of memory invocations. Unlike other object-oriented languages, C++ does not contain an automatic memory management policy among its language features. This paper presents a garbage collection strategy, called GC++, which collects garbage automatically with high speed of object allocation/deallocation. This high speed allocation/deallocation come from the utilization of memory allocation/deallocation behavior.The C++ allocation/deallocation patterns are determined experimentally in this paper. The proposed scheme is made feasible by minimizing memory allocation/deal-location calls and reusing objects based on other empirical investigations. To implement GC++, we applied the technique of Smart Pointer, which is one of the standard template containers. Our allocation scheme is simple and fast, since it requires no splitting and coalescing, and reduces the number of malloc() calls. It maintains its own free-list, which is used for object-reuse. Our scheme is purely source-code oriented and built on the top of the normal C++ memory manager. Therefore, this approach is portable, can be applied with existing code and is safe to use with different memory managers.