Explain how the JVM manages memory, and describe how you would diagnose a memory leak in a production Spring Boot application.