The object-oriented programming (OOP) language systems tend to perform obje
ct creation and deletion prolifically. An empirical study has shown that C+ programs can have 10 times more memory allocation and deallocation than c
omparable C programs. However, the allocation behavior of C++ programs is r
arely reported. This paper attempts to locate where the dynamic memory allo
cations are coming from and report an empirical study of the allocation beh
avior of C++ programs. Firstly, this paper summarizes the hypothesis of sit
uations that invoke the dynamic memory management explicitly and implicitly
. They are: constructors, copy constructors, overloading assignment operato
r=, type conversions and application-specific member functions. Secondly, t
he development of a source code level tracing tool is reported as a procedu
re to investigate the hypothesis. Most of the five C++ programs traced are
real-world applications. Thirdly, allocation patterns, object size and age
distribution are summarized. Among other things, we found that objects tend
to have a very short life-span, and most of them are created through const
ructors and copy constructors. With these findings, we may improve the perf
ormance of dynamic memory management through, a profile-based strategy or r
eusing objects. (C) 2001 Elsevier Science Inc. All rights reserved.