pub fn spawn_oom_watchdog(
threshold_mb: usize,
interval: Duration,
) -> Option<JoinHandle<()>>Expand description
2026-09-25: Spawn the OOM watchdog on the tokio runtime, or return None
if one was already spawned.
Every interval it reads cuda_free_memory_bytes. Below threshold_mb
MiB it logs an error; at the third consecutive such reading it calls
std::process::exit(1). A reading at or above the threshold resets the
count, and a None reading leaves it unchanged. Dropping the returned
handle does not stop the task.