aboutsummaryrefslogtreecommitdiffstats
path: root/modules/viewvc/templates/kill_viewvc.sh
blob: 4c27d3f3ff028f76906bc38ec7a20de9a06902cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

max_memory=1000000

for process in `pgrep viewvc.fcgi`
do
    process_mem=$(pmap "$process" | grep total | sed 's/ \+total \+\([[:digit:]]\+\)K/\1/')
    if [ "$process_mem" -gt "$max_memory" ]
    then
	kill -15 "$process"
    fi
done