Seeing a Memory Leak in Task Manager

Hey,

I created a program and I didn't think I was freeing dynamic memory correctly so I opened the task manager and ran my program concurrently; Everytime I pushed a button, it reloaded an image and the memory process went up almost immediately after. There seemed to be a direct correlation to the memory the process was using and me hitting the button.

If your program has a memory leak, can you see your memory usage grow exponentially in the task manager? (Assuming you don't have dynamic elements like stacks, queues, lists, ect... as I believe that will allocate dynamic memory as the program runs).

Last edited on
From what you described it seems that you do indeed have a leak, that is if hitting the button is really only "reloading" a image and not making a new one. It sounds to me as if the image you are reloading isn't deleting the old image after it creates the new one as the replacement. Maybe it is something missed in a dtor. Probably will have to run it through with a compiler to see exactly what is happening.

It can be tricky to notice a memory leak just by monitoring memory usage in the task manager but it surely is possible to notice it depending on how complicated the program itself is.

Though there is a specific tools availible that do a much better job at finding memory leaks which you might want to look into if you are interested. The best of them will mostly be paid applications but there is still quite good ones that are free.
Topic archived. No new replies allowed.