Skip to content

Profiling & Diagnostics

The profiling module provides native V8 diagnostic facilities for capturing CPU profiles, taking heap snapshots, and inspecting memory growth trends. It integrates with Node.js inspector sessions to allow runtime diagnostic sampling without requiring server restarts. These tools assist operators in diagnosing performance regressions and memory leaks under production traffic.

SymbolKindSignaturePurpose
ProfilerConfiginterfaceinterface ProfilerConfigProfiler configuration
ProfileResultinterfaceinterface ProfileResultProfile result
ProfileNodeinterfaceinterface ProfileNodeProfile node representing a function call
CallFrameinterfaceinterface CallFrameCall frame information
ProfileAnalysisinterfaceinterface ProfileAnalysisProfile analysis result
HotFunctioninterfaceinterface HotFunctionHot function information
SamplingResultinterfaceinterface SamplingResultSampling result
Sampleinterfaceinterface SampleIndividual sample
CPUProfilerclassclass CPUProfilerCPU Profiler class
createCPUProfilerfunctionfunction createCPUProfiler(config?: Partial<ProfilerConfig>): CPUProfilerCreate a CPU profiler with default configuration
MemoryProfilerConfiginterfaceinterface MemoryProfilerConfigMemory profiler configuration
Snapshotinterfaceinterface SnapshotHeap snapshot reference
Comparisoninterfaceinterface ComparisonSnapshot comparison result
LeakSuspectinterfaceinterface LeakSuspectSuspected memory leak
AllocationProfileinterfaceinterface AllocationProfileAllocation profile
Allocationinterfaceinterface AllocationSingle allocation event
GCMonitorinterfaceinterface GCMonitorGC monitor interface
GCEventinterfaceinterface GCEventGC event
GCMonitorStatsinterfaceinterface GCMonitorStatsGC monitoring statistics
RetentionTreeinterfaceinterface RetentionTreeRetention tree for object analysis
RetentionNodeinterfaceinterface RetentionNodeRetention tree node
MemoryProfilerclassclass MemoryProfilerMemory profiler class
createMemoryProfilerfunctionfunction createMemoryProfiler(Create a memory profiler with default configuration

Controls V8 CPU sampling sessions and produces Chrome DevTools-compatible .cpuprofile exports.

Inspects V8 heap statistics and triggers targeted garbage collection cycles during testing.

Serializes process heap graphs to disk for offline retention and leak graph analysis.

  • src/profiling/cpu-profiler.ts
  • src/profiling/memory-profiler.ts