Walk me through how you would identify and resolve a memory leak in a complex Java-based application.