Found huge memory leak in Harvard Shuttle
So it turned out there was a huge memory leak in the Harvard Shuttle app I just released. I was doing a pretty good job of cleaning up my data structures, even though there was really no need to in a managed language like C#. But lo and behold, when I opened up Task Manager to kill something, I saw that my app took up over 500MB of RAM (!!!). Either way, I definitely should’ve ran a memory profile on the app before sending it out.
It took me a while to find a good tool to figure out where the memory leak was coming from. I eventually came across this post, which is a super detailed, step-by-step process on how to hunt down memory leaks with any C# app (for whatever reason, WinDBG didn’t play nice with my app; not sure if this is my fault, or a Windows Store app issue). For the TL;DR, you’ll need to download a tool called PerfView, which is linked in the article, and use that to create a diff between two snapshots of the heap for your app. From there, you can figure out where the memory leak is coming from.