Skip to content

Busy Processes

The eight busiest processes on this Mac by CPU, with memory, updated every 10 seconds while the card is open. Quit one of yours in a click. Mac only.

by TailApps · Version 1 · Updated 20 hours ago

Price
Free
Works on
Mac
Permissions
2

What it does

  • Lives where you glance

    Menu bar, TailApps Dock, Dashboard and a floating window on your Mac.

  • Stays up to date

    Runs its script procs.sh on your Mac every 10 seconds

What it may do

TailApps shows this list before installing and asks you once. The card can do nothing else.

  • Run its script procs.sh

    script:procs.sh

  • Run its script quit.sh

    script:quit.sh

Scripts

Everything it runs is here to read before you install.

procs.sh
#!/bin/sh
# The busiest processes on this Mac by CPU, as JSON: [{ "pid", "name", "cpu" (1 = one core), "memory" (bytes), "mine" }].
# TailApps' own process ($TAILAPPS_PID) is left out: apps can't stop TailApps.
me=$(/usr/bin/id -u)
/bin/ps -Aco pid=,uid=,pcpu=,rss=,comm= -r | awk -v self="$TAILAPPS_PID" -v me="$me" '
  $1 != self && n < 8 {
    pid = $1; uid = $2; cpu = $3; rss = $4
    $1 = ""; $2 = ""; $3 = ""; $4 = ""
    name = $0; sub(/^ +/, "", name); gsub(/["\\]/, "", name)
    printf "%s{\"pid\":%s,\"name\":\"%s\",\"cpu\":%s,\"memory\":%d,\"mine\":%s}", (n++ ? "," : "["), pid, name, cpu / 100, rss * 1024, (uid == me ? "true" : "false")
  }
  END { print (n ? "]" : "[]") }'
quit.sh
#!/bin/sh
# Ask process $1 to quit (SIGTERM). Only your own processes; never TailApps itself.
case "$1" in ''|*[!0-9]*) echo "Not a process id: $1" >&2; exit 1 ;; esac
[ "$1" = "$TAILAPPS_PID" ] && { echo "TailApps can't be stopped from a card" >&2; exit 1; }
kill -TERM "$1"
Report Busy Processes?

Tell us what’s wrong with this card. We read every report.

What’s wrong