MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / handle_memory_pressure

Method handle_memory_pressure

graphlite/src/cache/cache_manager.rs:555–572  ·  view source on GitHub ↗

Handle memory pressure by triggering evictions

(&self, current_usage: usize, max_usage: usize)

Source from the content-addressed store, hash-verified

553
554 /// Handle memory pressure by triggering evictions
555 pub fn handle_memory_pressure(&self, current_usage: usize, max_usage: usize) {
556 let event = InvalidationEvent::MemoryPressure {
557 current_usage,
558 max_usage,
559 };
560 let _result = self.invalidation_manager.handle_event(event.clone());
561
562 // Force evictions in result and plan caches
563 // This would need to be implemented as aggressive eviction methods
564
565 self.record_event(CacheEvent::Eviction {
566 cache_type: "all".to_string(),
567 reason: "memory_pressure".to_string(),
568 timestamp: Instant::now(),
569 });
570
571 self.update_global_stats();
572 }
573
574 /// Clear all caches
575 pub fn clear_all(&self) {

Callers

nothing calls this directly

Calls 4

handle_eventMethod · 0.80
cloneMethod · 0.80
record_eventMethod · 0.80
update_global_statsMethod · 0.80

Tested by

no test coverage detected