Describe how garbage collection works in the JVM and how you would diagnose a memory leak in a production environment.