clock-applet memory leak

Przemek Klosowski przemek.klosowski at nist.gov
Tue Apr 23 14:30:14 UTC 2013


On 04/23/2013 12:25 AM, Conrad Meyer wrote:
> On Mon, 22 Apr 2013 12:55:00 -0400
> Przemek Klosowski <przemek.klosowski at nist.gov> wrote:
>
>> I reported the large memory leak in clock-applet:
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=952763
>>
>> (TLDR: clock-applet grows by 1GB/day when reporting weather)
>
> Ouch. Until this is fixed, I duct-taped around by adding this
> line to cron:
>
> */5 * * * * /home/conrad/kill_clock_applet_leak.sh
>
> Script:
>
> #!/bin/bash
>
> memused="`ps auxwww|grep clock-ap[p]let | awk '{ print $6 }'`"
>
> if [[ $memused -gt 250000 ]]; then
>      memhuman="$((memused/1024))"
>      echo "Clock-applet using $memhuman MB, killing panel"
>      pkill gnome-panel
> fi
>
>
> It's ugly and dumb, but should prevent run-away stupidity...
> (kills at 250MB RSS).

I played those games too---I found a direct way of getting memory use of 
a given process from ps:  memMB=$[`ps -o rss= -C clock-applet`/1024]

BTW, why did you use 'clock-ap[p]let'?

FWIW, here's a snippet that I used to collect data on memory used by the 
app vs. time (minutes):

printf -v ti '%(%s)T' -1;
while sleep 60 ; do
	printf -v t '%(%s)T' -1;
	echo $[($t-$ti)/60] `ps  -o rss= -C clock-applet` ;
done




More information about the devel mailing list