hrydgard/ppsspp — pull request #5771 by unknownbrackets (2014-03-30 22:53:33+00:00)
Title: Stick a cork in some memory leaks

This improves memory leaking when for example running the auto tests, and likely actually running games (I know some games open/close fonts in ways I expect was leaking quite a bit before.)

I think I *finally* figured out why x64 on the buildbot has never been able to complete the unit tests: it's running out of memory. If I run all of the unit tests 4x, I also run out of memory (in fact, I got to see a new Windows error message I've never seen before about running out of RAM and closing random programs to save me.) It fails in random places, bad_alloc, executable memory, 4gb base, etc.

With the changes here, the leaking is a lot better, and the working set actually doesn't leak much or possibly not at all (except for initialized things, like fonts or ffmpeg.) However the commit charge leaks like a faucet.

After the first test (run 3x), the commit charge is 18 MB having peaked at 69 MB. When it crashes (I'm not sure why this is all it takes for it to crash...?) the process commit charge is 143 MB having peaked at 194 MB. This is after 235 tests or so (each run 3x, so I guess > 700 total.) It seems to leak approximate 168 KB per test.

VLD doesn't seem to detect any leaks, and didn't detect any of these that I found manually... grr.

-[Unknown]