Now open application from browser and open page you want to profile. Then stop web2py server. To view result run command ‘mprof plot’. But to plot result you need package ‘matplotlib’.
To install matplotlib, first install required packages for matplotlib:

1

sudo apt-get build-dep python-matplotlib

Now install matplotlib:

1

sudo pip install matplotlib

Now run following command to get memory profile graph (Memory Usage vs Time):

1

mprof plot

The available commands for mprof :

mprof run: running an executable, recording memory usage

mprof plot: plotting one the recorded memory usage (by default, the last one)