Shit. For about a second and a half I honestly thought I was color-blind when I was looking for the green squares and I couldn't see them right away. Genuinely scared me. Obviously time for bed.
There are some open-source heap managers out there. It might be interesting to replace malloc with one of those and see if they don't do a better job of keeping the heap defragmented. Quite honestly, its a problem that's been done before. I sure hope they don't go reinventing the wheel.