Expand description
Advanced memory profiling for TrustformeRS models.
This module provides comprehensive memory profiling capabilities including:
- Heap allocation tracking
- Memory leak detection
- Peak memory analysis
- Allocation patterns
- GC pressure analysis
- Memory fragmentation monitoring
§Example
use trustformers_debug::{MemoryProfiler, MemoryProfilingConfig};
let config = MemoryProfilingConfig::default();
let mut profiler = MemoryProfiler::new(config);
profiler.start().await?;
// ... run model training/inference ...
let report = profiler.stop().await?;
println!("Peak memory usage: {} MB", report.peak_memory_mb);
println!("Memory leaks detected: {}", report.potential_leaks.len());Structs§
- Allocation
Pattern - Allocation pattern detected by analysis
- Allocation
Record - Allocation record for tracking individual allocations
- Allocation
Type Stats - Statistics for each allocation type
- Fragmentation
Analysis - Memory fragmentation analysis
- GCPressure
Analysis - Garbage collection pressure analysis
- Memory
Leak - Memory leak information
- Memory
Profiler - Memory profiler implementation
- Memory
Profiling Config - Configuration for memory profiling
- Memory
Profiling Report - Comprehensive memory profiling report
- Memory
Snapshot - Memory usage snapshot at a point in time
Enums§
- Allocation
Type - Type of allocation
- Fragmentation
Severity - Fragmentation severity levels
- GCPressure
Level - GC pressure levels
- Leak
Severity - Severity of memory leak
- Pattern
Type - Type of allocation pattern