Log current memory status
(&self, current_memory: u64, pressure: MemoryPressure)
| 304 | |
| 305 | /// Log current memory status |
| 306 | fn log_memory_status(&self, current_memory: u64, pressure: MemoryPressure) { |
| 307 | let current_mb = current_memory as f64 / (1024.0 * 1024.0); |
| 308 | let threshold_mb = self.config.memory_threshold as f64 / (1024.0 * 1024.0); |
| 309 | |
| 310 | match pressure { |
| 311 | MemoryPressure::Low => { |
| 312 | debug!("Memory usage: {:.1}MB (threshold: {:.1}MB)", current_mb, threshold_mb); |
| 313 | } |
| 314 | MemoryPressure::Medium => { |
| 315 | info!("Memory usage: {:.1}MB - approaching threshold ({:.1}MB)", current_mb, threshold_mb); |
| 316 | } |
| 317 | MemoryPressure::High => { |
| 318 | warn!("Memory usage: {:.1}MB - above threshold ({:.1}MB)", current_mb, threshold_mb); |
| 319 | } |
| 320 | MemoryPressure::Critical => { |
| 321 | warn!("Memory usage: {:.1}MB - CRITICAL level (threshold: {:.1}MB)", current_mb, threshold_mb); |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | /// Register a cleanup callback function |
| 327 | pub fn register_cleanup_callback<F>(&self, callback: F) |
no outgoing calls
no test coverage detected