Expand description
Memory profiling utilities for tracking allocations and memory usage.
This module provides tools for:
- Tracking heap allocations
- Monitoring shared memory usage
- Detecting potential memory leaks
- Measuring peak memory consumption
§Examples
use ipfrs_tensorlogic::MemoryProfiler;
let profiler = MemoryProfiler::new();
{
let _guard = profiler.start_tracking("my_operation");
// Your operation here
let data = vec![0u8; 1024 * 1024]; // 1 MB allocation
drop(data);
}
let stats = profiler.get_stats("my_operation").unwrap();
println!("Peak memory: {} bytes", stats.peak_bytes);Structs§
- Memory
Profiler - Memory profiler for tracking allocations and usage
- Memory
Profiling Report - A comprehensive memory profiling report
- Memory
Stats - Memory usage statistics for a tracked operation
- Memory
Tracking Guard - A guard that tracks memory usage for the duration of its lifetime