Module memory_profiler

Module memory_profiler 

Source
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§

MemoryProfiler
Memory profiler for tracking allocations and usage
MemoryProfilingReport
A comprehensive memory profiling report
MemoryStats
Memory usage statistics for a tracked operation
MemoryTrackingGuard
A guard that tracks memory usage for the duration of its lifetime