How can you detect and fix memory leaks?

Technical