I've noticed when I open and close my program multiple times, my ram starts filling up. Up to gigs worth of ram. After restarting my computer and not opening it, I haven't had this problem.
What I'm confused about is that I thought Windows cleared up all the memory used by an application after it closes. How true is that?
Then again, for all I know, it might have nothing to do with my program.
Maybe it was something else and I'm just pointing fingers at something completely unrelated. I just want to know if it's safe to start running it again.
This is probably more closely related to Visual Studio or Operating Systems, but I didn't know of any forum for that.
I don't know if I have memory leaks in my program but it's likely since I don't know much about what to delete or how to delete stuff at the end of a program.
It doesn't go away after I close Visual Studio either.
Like I said, it could have nothing to do with the program and might just be some unrelated program on my computer. I just want to know if memory created by a program can be left behind when a program closes.
Can you create a minimal test case? Try removing code until you have the minimal amount to reproduce the issue. If at some point the issue goes away, then the code you removed is the culprit.
> I've noticed when I open and close my program multiple times, my ram starts filling up.
Your ram should start filling up if your program is performing large amounts of file i/o on different files or using a lot of memory mapped sections. In this scenario, you ought to be worried only if the ram does not start filling up when the program has been run.
One of the strengths of Windows, right from NT 3.51, is excellence in memory management. So much so, that many of Dave Cutler's innovations are now incorporated into other operating systems like the BSDs and Linux.
> There aren't any news in my program, so I'm guessing it's something else taking up all the memory.
Memory leaks in the program are irrelevant; all private memory of a process is released when the process ends. (Antivirus software may be mapping some of the process memory; but this does not stay for long after the process has ended.)