aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-02-05 02:16:18 +0100
committerDuncaen <mail@duncano.de>2017-02-05 02:16:18 +0100
commit9ca97c271a5779735c0f14ee860fa4426e062441 (patch)
tree925a9f372eed90f8f7c486329bf30b4dd36f2392
parent4aade0b49c3d889e9563435476022281b60ddf8c (diff)
downloaddotfiles-9ca97c271a5779735c0f14ee860fa4426e062441.tar.gz
bin: add oomtop
-rwxr-xr-xbin/oomtop8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/oomtop b/bin/oomtop
new file mode 100755
index 0000000..2f0ad78
--- /dev/null
+++ b/bin/oomtop
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+printf "score\tpid\tcommand\n" >&2
+for f in /proc/[0-9]*; do
+ s=$(cat "$f/oom_score")
+ [ "$s" -eq 0 ] && continue
+ printf "%d\t%d\t%s\n" "$s" "${f#*/proc/}" "$(cat "$f/comm")"
+done | sort -nr