From c1baed642e3d4dd7eb298c7f75239fa749c0ad7d Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Thu, 18 Sep 2025 14:43:42 -0300 Subject: [PATCH] Script to monitor memory usage. --- scripts/memwatch.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 scripts/memwatch.sh diff --git a/scripts/memwatch.sh b/scripts/memwatch.sh new file mode 100755 index 000000000..0b87dd906 --- /dev/null +++ b/scripts/memwatch.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +PID=$1 + +while true; do + # Clear the screen + clear + # Print the header + RSS in GB + ps -p "$PID" -o pid,comm,rss | \ + awk 'NR==1 {print $0, "rss_GB"} NR>1 {printf "%s %s %s %.2f\n", $1,$2,$3,$3/1024/1024}' + sleep 1 +done \ No newline at end of file