/** * Memory Management Plugin * Handles TensorFlow.js memory allocation, cleanup, and monitoring */ import * as tf from '@tensorflow/tfjs-core'; import type { IMemoryPlugin, MemoryStats, PluginState } from '../core/interfaces'; export interface MemoryPluginConfig { maxMemoryMB: number; cleanupThreshold: number; cleanupInterval: number; enableMonitoring: boolean; enableProfiling: boolean; tensorTracking: boolean; } export declare class MemoryPlugin implements IMemoryPlugin { readonly id = "memory-plugin"; readonly name = "Memory Management Plugin"; readonly version = "2.0.0"; state: PluginState; private config; private cleanupTimer; private monitoringTimer; private tensorRegistry; private memoryHistory; private peakMemory; private totalAllocated; private cleanupCount; constructor(config?: Partial); initialize(config?: Partial): Promise; dispose(): Promise; isReady(): boolean; /** * Allocate memory and track usage */ allocate(size: number): Promise; /** * Perform memory cleanup */ cleanup(): Promise; /** * Get current memory statistics */ getStats(): MemoryStats; /** * Start memory monitoring */ monitor(): void; /** * Stop memory monitoring */ stopMonitoring(): void; /** * Track a tensor for automatic cleanup */ trackTensor(tensor: tf.Tensor): void; /** * Untrack a tensor */ untrackTensor(tensor: tf.Tensor): void; /** * Get memory usage history */ getMemoryHistory(): MemoryStats[]; /** * Get peak memory usage */ getPeakMemory(): number; /** * Get cleanup statistics */ getCleanupStats(): { count: number; totalFreed: number; }; /** * Check if memory usage is above threshold */ isMemoryPressure(): boolean; /** * Get current memory statistics */ private getCurrentMemoryStats; /** * Start memory monitoring */ private startMonitoring; /** * Start cleanup timer */ private startCleanupTimer; /** * Stop cleanup timer */ private stopCleanupTimer; /** * Setup TensorFlow.js tensor tracking */ private setupTensorTracking; /** * Get plugin configuration */ getConfig(): Required; /** * Update plugin configuration */ updateConfig(newConfig: Partial): Promise; } //# sourceMappingURL=memory-plugin.d.ts.map