A study of the allocation behavior of C++ programs

Citation
Jm. Chang et al., A study of the allocation behavior of C++ programs, J SYST SOFT, 57(2), 2001, pp. 107-118
Citations number
14
Categorie Soggetti
Computer Science & Engineering
Journal title
JOURNAL OF SYSTEMS AND SOFTWARE
ISSN journal
01641212 → ACNP
Volume
57
Issue
2
Year of publication
2001
Pages
107 - 118
Database
ISI
SICI code
0164-1212(20010615)57:2<107:ASOTAB>2.0.ZU;2-B
Abstract
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.