Me and a small team have been working on a project that is starting to take up quite a lot of memory (for a domestic program). We are using C++20, and to my knowledge don't use anything other than smart pointers in the project.
We believe we have a memory leak somewhere, but are finding it hard to track down, and have also been very confused about the various diagnostic results we are getting from different sources. All three of the following cases were taken at exactly the same time. (Taken on Windows 10, x64)
- Below is our in-game profiler. We are using:
PROCESS_MEMORY_COUNTERS_EX pmc;
GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*)&pmc, sizeof(pmc));
As you can see, it reports ~760 MB of memory usage.
- Below is what VS2019 shows us (again, at exactly the same time). ~1.5GB of "private bytes", but also only ~44KB on the heap? (Our whole application is run from a smart pointer in our main function, so it should all be in the heap, right?).
- Finally, task manager is below. This is the memory usage, and is roughly what we report in-game, but always a little bit lower.
In my eyes, all of these conflict somewhat, and I am utterly perplexed by the VS output. Any explanation as to what VS's output is would be greatly appreciated.


