vercel/next.js · error

Memory debugging mode is enabled. Note: This will affect per

Error message

Memory debugging mode is enabled. Note: This will affect performance.

What it means

enableMemoryDebuggingMode (memory debugging instrumentation used by next build) warns once that the mode is active: V8 flags are set for near-heap-limit snapshots, GC observation and periodic tracing are running, all of which reduce performance; purely informational.

Source

Thrown at packages/next/src/lib/memory/startup.ts:34

  // close to the memory limit rather than continuing to try to collect
  // memory ineffectively.
  v8.setFlagsFromString('--detect-ineffective-gcs-near-heap-limit')

  // This allows users to generate a heap snapshot on demand just by sending
  // a signal to the process.
  process.on('SIGUSR2', () => {
    warn(
      `Received SIGUSR2 signal. Generating heap snapshot. ${italic(
        'Note: this will take some time.'
      )}`
    )
    v8.writeHeapSnapshot()
  })

  startObservingGc()
  startPeriodicMemoryUsageTracing()

  warn(
    `Memory debugging mode is enabled. ${italic(
      'Note: This will affect performance.'
    )}`
  )
  info(
    ' - Heap snapshots will be automatically generated when the process reaches more than 70% of the memory limit and again when the process is just about to run out of memory.'
  )
  info(
    ` - To manually generate a heap snapshot, send the process a SIGUSR2 signal: \`kill -SIGUSR2 ${process.pid}\``
  )
  info(
    ' - Heap snapshots when there is high memory will take a very long time to complete and may be difficult to analyze in tools.'
  )
  info(
    ' - See https://nextjs.org/docs/app/building-your-application/optimizing/memory-usage for more information.'
  )
}

View on GitHub (pinned to 0eb3775416)

Solutions

  1. Disable memory debugging mode when not diagnosing memory issues to restore performance.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/next/src/lib/memory/startup.ts:34 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19). Data as JSON: /api/errors/6ff9bb02949b04c5. Report an issue: GitHub.