diff --git a/src/obisys/src/lib.rs b/src/obisys/src/lib.rs index d058467..5867eca 100644 --- a/src/obisys/src/lib.rs +++ b/src/obisys/src/lib.rs @@ -117,24 +117,20 @@ fn diagnose(s: &StageStats, n_cores: usize) -> Diagnosis { let cpu_pct = eff * 100.0; let io_ops = s.in_blocks + s.out_blocks; + // swaps > 0 is the only reliable cross-platform indicator of true RAM exhaustion. + // ru_majflt is intentionally excluded: on macOS it counts all file-backed mmap + // page-ins (even from page cache), making it useless as a memory-pressure signal + // for mmap-heavy code. On Linux it is more meaningful, but swaps covers the + // severe case on both platforms. if s.swaps > 0 { return Diagnosis { tag: "swapping", detail: Some(format!( - "swapped {} time(s) — severe memory pressure, consider increasing RAM", + "swapped {} time(s) — working set exceeds available RAM", s.swaps, )), }; } - if s.major_faults > 10 { - return Diagnosis { - tag: "mem pressure", - detail: Some(format!( - "{} major page faults — working set exceeds available RAM", - s.major_faults, - )), - }; - } if eff < 0.3 && io_ops > 100 { return Diagnosis { tag: "disk I/O",