Repository navigation
Best practice for monitoring memory pressure events in bash scripts? #4
Answered
by
amitpadhan525
amitpadhan979
asked this question in
Q&A
|
Hi! I noticed the system diagnostic scripts under system-info/. Is there a recommended approach in this collection to monitor memory pressure (such as checking PSI /proc/pressure/memory on modern Linux kernels) rather than relying solely on raw free memory percentages? |
Answered by
amitpadhan525
Oct 5, 2026
Replies: 1 comment
|
Great question! On modern kernels (Linux 4.20+), checking Pressure Stall Information (PSI) via Here is a clean pattern you can use in shell scripts: #!/usr/bin/env bash
if [[ -f /proc/pressure/memory ]]; then
# avg10 indicates percentage of time tasks were stalled on memory over last 10 seconds
awk '/some/ {print $2}' /proc/pressure/memory
fiWe plan to integrate PSI metrics into |
0 replies
Answer selected by
amitpadhan525
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great question! On modern kernels (Linux 4.20+), checking Pressure Stall Information (PSI) via
/proc/pressure/memoryis much more reliable than static free memory percentages because it measures actual execution stall times during memory contention and paging.Here is a clean pattern you can use in shell scripts:
We plan to integrate PSI metrics into
system_info.shin an upcoming update.