Memory Management: Overloading Operator new and delete 1

In this lesson, we will learn how to overload the operators new and delete so we can manage memory in a better way.

It happens quite often that a C++ application allocates memory but does not deallocate it. This is the job for the operators new and delete. Due to both features, you can explicitly manage the memory management of an application.

Occasionally, we must verify that an application has correctly released its memory. In particular, for programs running for long periods of time, it is a challenge to allocate and deallocate memory from a memory management perspective. Of course, the automatic release of the memory during the shutdown of the program is not an option.

The Baseline

As a baseline for our analysis, we use a simple program that often allocates and deallocates memory.

Get hands-on with 1000+ tech skills courses.