I played a little to get what I wanted from these links, but here it is. (Most of the difficulty was getting him to work on Mingw32.)
// -*- compile-command:"g++ mem.cpp -lpsapi -g -o mem.exe"; -*- // Shows the memory: private bytes, working set and virtual size for a process
source share