{"record":{"id":"6ff9bb02949b04c5","repo":"vercel/next.js","slug":"memory-debugging-mode-is-enabled-note-this-will","errorCode":null,"errorMessage":"Memory debugging mode is enabled. Note: This will affect performance.","messagePattern":"Memory debugging mode is enabled\\. Note: This will affect performance\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/memory/startup.ts","lineNumber":34,"sourceCode":"  // close to the memory limit rather than continuing to try to collect\n  // memory ineffectively.\n  v8.setFlagsFromString('--detect-ineffective-gcs-near-heap-limit')\n\n  // This allows users to generate a heap snapshot on demand just by sending\n  // a signal to the process.\n  process.on('SIGUSR2', () => {\n    warn(\n      `Received SIGUSR2 signal. Generating heap snapshot. ${italic(\n        'Note: this will take some time.'\n      )}`\n    )\n    v8.writeHeapSnapshot()\n  })\n\n  startObservingGc()\n  startPeriodicMemoryUsageTracing()\n\n  warn(\n    `Memory debugging mode is enabled. ${italic(\n      'Note: This will affect performance.'\n    )}`\n  )\n  info(\n    ' - 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.'\n  )\n  info(\n    ` - To manually generate a heap snapshot, send the process a SIGUSR2 signal: \\`kill -SIGUSR2 ${process.pid}\\``\n  )\n  info(\n    ' - Heap snapshots when there is high memory will take a very long time to complete and may be difficult to analyze in tools.'\n  )\n  info(\n    ' - See https://nextjs.org/docs/app/building-your-application/optimizing/memory-usage for more information.'\n  )\n}\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/memory/startup.ts#L16-L52","documentation":"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.","triggerScenarios":"Thrown at packages/next/src/lib/memory/startup.ts:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disable memory debugging mode when not diagnosing memory issues to restore performance."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}