Handle memory pressure by triggering evictions
(&self, current_usage: usize, max_usage: usize)
| 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) { |
nothing calls this directly
no test coverage detected