What happens to memory that you never free or delete

What are some problems that occur if you never delete memory? What happens when main finishes and you never deleted your pointers?
Never freeing memory you allocated with malloc() or new will result in a memory leak. The object still exists in RAM, taking up space, but is never accessible if the pointers to it are nullified. When the program terminates, the OS will deallocate all the memory used, but don't rely on the computer to clean up the mess left behind from your program. Programs you build might have to run for a while and the memory leaks will waste memory that other programs need. If you allow enough memory leaks to occur, all the RAM will be used up and the computer will slow down incredibly, freeze, or maybe crash.

There is also the very real chance the never freeing memory will result in damage to your computer that can only be fixed by rebooting.

Feel free to correct me.
Topic archived. No new replies allowed.