2 # This file is part of PulseAudio.
4 # Copyright 2015 Ahmed S. Darwish <darwish.07@gmail.com>
6 # PulseAudio is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU Lesser General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # PulseAudio is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public License
17 # along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
20 # PulseAudio memory usage plotting script
22 # Before invocation, generate necessary data by running the
23 # 'benchmark_memory_usage.sh' bash script. Afterwards, you can plot
24 # such data by running:
26 # gnuplot plot_memory_usage.gp
28 # Note! To avoid scaling issues, memory is plotted in a "double y axis"
29 # form, with VM usage on the left, and dirty RSS memory usage on the
30 # right. The scales are different.
33 # Print our user messages to the stdout
36 benchDir = system('dirname ' .ARG0) .'/benchmarks/'
37 inputFile = benchDir ."memory-usage-LATEST.txt"
38 outputFile = benchDir ."pulse-memory-usage.png"
40 set title "PulseAudio Memory Usage Over Time"
41 set xlabel "Number of councurrent 'paplay' clients"
43 set ylabel "Virtual memory consumption (GiB)"
44 set y2label "Dirty RSS consumption (MiB)"
48 # Finer granulrity for x-axis ticks ...
52 # Use Cairo's PNG backend. This produce images which are way
53 # better-rendered than the barebone classical png backend
54 set terminal pngcairo enhanced size 1000,768 font 'Verdana,10'
57 print "Plotting data from input file: ", inputFile
60 plot inputFile using 1:($2/1024/1024) title "VmSize" axes x1y1 with linespoints, \
61 inputFile using 1:($3/1024) title "Dirty RSS" axes x1y2 with linespoints
63 print "Done! Check our performance at: ", outputFile