ABSTRACT

Memory usage directly impacts soware correctness and perfor-mance. In this chapter, we consider memory management within a program. We begin with an overview of memory used for running programs, dierentiating between program stack and heap memory. We examine the task of copying data, when that data is stored in heap memory, noting dierences inherent in programming languages. We briey discuss memory allocation and deallocation schemes, including explicit deallocation, garbage collection, and reference counting.