Q: I have a program which mallocs and later frees a lot of memory, but I can see from the operating system that memory usage doesn't actually go back down.
A: Most implementations of malloc/free do not return freed memory to the operating system, but merely make it available for future malloc calls within the same program.
Additional links: further reading