Describe a scenario where you had to debug a memory leak in a Java application. What tools did you use, and how did you resolve the issue?