# Codex Jvm Memory Leak Review

> Review changed Java or Kotlin files for JVM and Spring memory leaks. Use during a diff review when .java or .kt files changed.

- Skill: `bk202503/codex-jvm-memory-leak-review` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add bk202503/codex-jvm-memory-leak-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bk202503/codex-jvm-memory-leak-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: BK202503 (https://skillmd.com/u/bk202503)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/bk202503/codex-jvm-memory-leak-review

---


# JVM memory-leak review

Determine the changed `.java` and `.kt` files from the current Git diff. Read only those files; read `pom.xml` or Gradle files only to resolve dependency versions, never as findings.

Check for:

- Static or companion-object mutable collections that accumulate without bounded eviction.
- `ThreadLocal` or security/request context values set without `finally` cleanup.
- Listeners, callbacks, or Flow collectors registered without lifecycle cancellation.
- Naked `ConcurrentHashMap` or cache configuration without size/TTL bounds.
- Streams, JDBC resources, or `EntityManager` instances opened without structured closing.
- Singleton beans retaining prototype, request, or session scoped objects.
- `@Async`, `CompletableFuture`, scheduled tasks, or coroutines retaining large mutable state.
- `Channel(UNLIMITED)`, excessive SharedFlow replay, and callbackFlow without `awaitClose`.

For every finding return severity (`must-fix`, `should-fix`, `consider`), file and line, memory-retention impact, and a concrete fix. Say `no JVM memory-leak pattern found` if none apply.

