I have an application that uses a 3rd party API and I think they are having a memory leak issue. I wrote a small test program (below) to test this out, please note, both `VMIListener` and `VMI` are from the APIs in which I'm implementing their virtual interface methods.

I don't have any memory leak behavior if I comment out the `VMI vmi;` under my `VMITest` class. With my limited knowledge in C++ I assume this is because the virtual VMI class does not have the virtual destructor.

However, my question is does Windows have some safeguard in place for maxing out memory from memory leak? Because I see an interesting result within the Windows Task Manager.

If I run my test program, it automatically jumped by roughly 2 Gigs and stays there (the first white circle area). If I run my actual application (2nd white area), the leak slowly reach up to about the same level (5.8 Gig) and in both case they stop there without further increase in the memory. I run several other tests where I let my application running, the leak stops when they reach this specific level of memory usage.

[![Memory indicator](https://i.stack.imgur.com/eSvtp.png)](https://i.stack.imgur.com/eSvtp.png)

```
void main(int cArgs, char* saArgs[])
{
     VMITest    *m_pVMI;

     while(true)
     {
         m_pVMI = new VMITest();
         delete m_pVMI;
         m_pVMI = NULL;
     }
 }

 class VMITest : public VMIListener
 {

    public:
           VMI  vmi;
           VMITest();

    // VMIListener interface methods.
 };

 class VMI_API VMI
 {
   public:
         VMI();
   //some more functions
 }

```