Expand description
§Advanced Memory Profiling for SciRS2 v0.2.0
This module provides comprehensive memory profiling capabilities using jemalloc. It enables heap profiling, memory leak detection, and allocation pattern analysis.
§Features
- Heap Profiling: Track memory allocations and deallocations
- Leak Detection: Identify memory leaks
- Allocation Patterns: Analyze allocation patterns
- Statistics: Detailed memory statistics
- Zero Overhead: Disabled by default, minimal overhead when enabled
§Example
use scirs2_core::profiling::memory_profiling::{MemoryProfiler, enable_profiling};
// Enable memory profiling
enable_profiling().expect("Failed to enable profiling");
// ... perform allocations ...
// Get memory statistics
let stats = MemoryProfiler::get_stats().expect("Failed to get stats");
println!("Allocated: {} bytes", stats.allocated);
println!("Resident: {} bytes", stats.resident);Structs§
- Allocation
Analysis - Allocation pattern analysis
- Allocation
Tracker - Allocation tracker for detecting patterns
- Memory
Delta - Memory delta from baseline
- Memory
Profiler - Memory profiler
- Memory
Stats - Memory statistics from jemalloc
Functions§
- disable_
profiling - Disable memory profiling
- enable_
profiling - Enable memory profiling