pub fn check_system_resources() -> ResourceStatusExpand description
Check system resource health
Monitors two key indicators:
- Process memory usage - Via macOS
pscommand (fails safe on other platforms) - GPU pending operation count - Proxy for GPU memory pressure
§Thresholds
Critical (operation should abort):
- Process memory >90% of system RAM
- GPU pending ops >100
Warning (elevated but operational):
- Process memory >70% of system RAM
- GPU pending ops >50
§Platform Support
- macOS: Full memory monitoring via
pscommand - Other platforms: Only monitors GPU pending count (memory always returns healthy)
§Example
ⓘ
use volta::gpu::monitor::{check_system_resources, ResourceStatus};
match check_system_resources() {
ResourceStatus::Critical(msg) => {
panic!("Test aborted - critical resources: {}", msg);
}
ResourceStatus::Warning(msg) => {
eprintln!("Warning: {}", msg);
}
ResourceStatus::Healthy => {}
}