mirror of
https://github.com/containerd/containerd.git
synced 2026-10-28 17:45:13 +08:00
The oomWatchers.Stop method stopped the watcher but never removed it from the watchers map. Because Add is the only writer and nothing ever deletes from the map, *watcher entries accumulated for the lifetime of the shim process. This resulted in an unbounded memory leak. Furthermore, this prevented the same container ID from ever being watched again if it was re-created, silently dropping OOM monitoring. This commit modifies Stop to delete(ows.watchers, cid), ensuring the watcher is released and the container ID is freed. Signed-off-by: Harshal Patel <106813066+HarshalPatel1972@users.noreply.github.com>