Memory leaks can be insidious problems that slowly degrade system performance. What memory leak detection techniques have you found most effective? I'm interested in both tools and methodologies. How do you differentiate between normal memory usage and actual memory leaks? What system diagnostic tools are best for memory leak detection across different operating systems?
For memory leak detection, I start with Task Manager's Memory column. Sort by memory usage and look for processes that keep growing over time. Restart the process if possible and see if memory usage climbs again. For more detailed memory leak detection, Process Explorer shows private bytes, working set, and commit size. Consistently increasing private bytes is a classic sign of a memory leak.
RAMMap from Sysinternals is amazing for memory leak detection. It shows you exactly how memory is being used. Look for processes with large Private" allocations that keep growing. Also, check for driver memory leaks they're harder to detect. PoolMon (also from Sysinternals) can help with this. Sometimes a driver is leaking pool memory, which won't show up as process memory.
On Linux, memory leak detection is different. I use top or htop to monitor memory usage over time. For more detailed memory leak detection, valgrind is the gold standard for developers. For production systems, checking /proc/meminfo and watching for decreasing MemFree" and increasing "Slab" can indicate kernel memory leaks. Sometimes a simple reboot fixes memory leaks until the bug is patched.