An integrated dynamic memory tracing tool for C++

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

  • Affiliations:
  • Department of Electrical & Computer Engineering, Iowa State University, Ames, IA;Department of Electrical & Computer Engineering, Iowa State University, Ames, IA

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

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dynamic memory management has been a high cost component in many software systems. A study has shown that memory intensive C programs can consume up to 30% of the program run time in memory allocation and liberation. Especially, in C++ programs, they tend to have object creation and deletion prolifically. C++ memory allocation rate can be as much as 10 times higher than the comparable applications written in C. Despite the importance of dynamic memory management in C++, there exist few software tools to study dynamic memory in C++. This paper introduces a tracing tool, called mtrace++, to study the dynamic memory allocation behavior in C++ programs.Mtrace++ is a source code level instrumented tracing tool which produces records of allocation and deallocation information. The allocation information contains size, type and path. The allocation paths may lead to indirect memory allocation. The collected traced data is analyzed by stat. Stat produces concise information from the traced data. Mtrace++ provides extended functionalities which include measuring life-spans and detecting memory leaks. With limited overheads, mtrace++ can help programmers to solve dynamic memory problems with affordable cost.