Back to Signal Feed
CodeTracked since May 18, 2026

Nanocoder adds periodic perf buffer cleanup to prevent long-session OOM crashes

The PR adds a startup guard for Ink-based runs that periodically clears Node performance entries so they no longer accumulate indefinitely in the global perf_hooks buffer during long-lived workflows.

Node.js perf_hooksInk (react-reconciler CLI)performance.clearMarksperformance.clearMeasures

What Happened

  • The PR adds a startup guard for Ink-based runs that periodically clears Node performance entries so they no longer accumulate indefinitely in the global perf_hooks buffer during long-lived workflows.
  • The PR adds a startup guard for Ink-based runs that periodically clears Node performance entries so they no longer accumulate indefinitely in the global perf_hooks buffer during long-lived workflows.
  • 1 evidence item attached for review.

What is Different

Before

Scattered source updates, isolated context, and manual follow-up across multiple feeds.

Now

Implemented `source/utils/perf-buffer.ts` with `installPerfBufferGuard()`, which starts a non-blocking 30-second cleanup timer that drains marks/measures/resource-timing entries, and integrated it into CLI startup so every interactive/run Nanocoder session begins with this guard active.

Why Track This

Why It Matters

Long-running Nanocoder users running many subagent turns are less likely to see hard crashes from `JavaScript heap out of memory`, so operators can keep automation sessions alive longer without manual restarts; monitor memory growth and crash incidence during very long runs to confirm the cleanup frequency remains sufficient under peak render/request load. The root fix removes a silent leak path from dev-mode React render timing calls and undici request timings that were never observed in Nanocoder, and periodically drains the global performance entry buffer that had previously been growing without bound.

Impact

Long-running Nanocoder users running many subagent turns are less likely to see hard crashes from `JavaScript heap out of memory`, so operators can keep automation sessions alive longer without manual restarts; monitor memory growth and crash incidence during very long runs to confirm the cleanup frequency remains sufficient under peak render/request load. The root fix removes a silent leak path from dev-mode React render timing calls and undici request timings that were never observed in Nanocoder, and periodically drains the global performance entry buffer that had previously been growing without bound.

What To Watch Next

  • Watch whether Node.js perf_hooks becomes a repeated pattern.
  • Track follow-up changes around AI Coding Agents.
  • Compare future signals against this evidence trail.
  • Re-check risk flags: watch_memory_before_and_after_long_ink_sessions, monitor_latency_impact_of_30s_cleanup_interval.
Open Topic TimelineOpen Technical EventOpen Original Sourcewatch_memory_before_and_after_long_ink_sessions / monitor_latency_impact_of_30s_cleanup_interval / verify_other_entry_sources_outside_ink_path_are_handled / confirm_no_critical_tooling_depends_on_unread_perf_hooks_entries

Supporting Evidence