/** * Advanced Memory Leak Detection System * * Provides comprehensive memory monitoring with growth rate analysis, * correlation coefficients, and automated alerting for memory leaks. * Uses statistical analysis to distinguish normal growth from problematic leaks. */ import { EventEmitter } from 'events'; interface MemorySnapshot { timestamp: number; heapUsed: number; heapTotal: number; external: number; rss: number; arrayBuffers: number; } interface MemoryGrowthAnalysis { growthRate: number; correlation: number; variance: number; leakProbability: number; trend: 'stable' | 'growing' | 'leaking' | 'fluctuating'; } /** * Advanced Memory Leak Detector */ export declare class AdvancedMemoryLeakDetector extends EventEmitter { private snapshots; private maxSnapshots; private snapshotInterval; private analysisWindow; private leakThreshold; private correlationThreshold; private intervalId?; private lastAlertTime; private alertCooldown; constructor(); /** * Start memory monitoring */ private startMonitoring; /** * Stop memory monitoring */ stop(): void; /** * Take memory snapshot */ private takeSnapshot; /** * Analyze memory trends using statistical methods */ private analyzeMemoryTrend; /** * Perform statistical analysis of memory growth */ private performGrowthAnalysis; /** * Calculate correlation coefficient for linear growth */ private calculateCorrelation; /** * Calculate variance of growth rates */ private calculateVariance; /** * Trigger memory leak alert with cooldown */ private triggerAlert; /** * Get current memory statistics */ getMemoryStats(): { snapshots: MemorySnapshot[]; analysis: MemoryGrowthAnalysis | null; currentUsage: MemorySnapshot | null; }; /** * Force garbage collection (if available) */ forceGC(): void; /** * Export memory statistics for monitoring */ exportMemoryReport(): string; } export default AdvancedMemoryLeakDetector; //# sourceMappingURL=advancedMemoryLeakDetector.d.ts.map