Plot the memory usage of arbitrary processes
pypi:
$ pip install memplot
From source:
$ git clone https://github.com/EricChiang/memplot.git
$ cd memplot
$ python setup.py install
What's the memory usage of the pickle
package? Let's consider the following script save under pickle_array.py
import numpy as np
import pickle
import time
x = np.random.randn(1000,10000)
time.sleep(1)
pickle.dump(x,open("x.pk","w"))
To plot memory usage run:
$ memplot "python pickle_array.py"
This command produces the following plot:
How does R do? Here's a similar serialization script saved as save_array.r
x <- matrix(rnorm(1000,10000),1000,10000)
Sys.sleep(1)
save(x,file="x.Rdata")
Time to plot the memory usage:
$ memplot "Rscript save_array.r"