MCPcopy Create free account
hub / github.com/erans/pgsqlite / log_memory_status

Method log_memory_status

src/protocol/memory_monitor.rs:306–324  ·  view source on GitHub ↗

Log current memory status

(&self, current_memory: u64, pressure: MemoryPressure)

Source from the content-addressed store, hash-verified

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)

Callers 1

check_memory_pressureMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected