The dynamics of changing dynamic memory allocation in a large-scale C++ application

  • Authors:
  • Neil B. Harrison;John H. Meiners

  • Affiliations:
  • Utah Valley State College, Orem, UT;Avaya, Inc., Westminster, CO

  • Venue:
  • Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Changing the approach to dynamic memory allocation in a large legacy application is challenging. In order to improve the robustness of memory allocation, we fundamentally changed it. We replaced standard heap allocation with class-specific heaps. We were able to do it with almost no changes to the existing class code by overriding the C++ new() and delete() operators, and using templates creatively to insert the changes into class hierarchies.The results have been very positive. Misuse of dynamic memory has been detected and errors caused by memory misuse have been avoided. Performance of the new memory management code has been as good or better as the previous code. Additional capabilities such as audits have been added to further increase the robustness of dynamic memory usage.