Hi matplotlib users and developers,

I am trying to run a web application using matplotlib in a memory constrained 
environment. I have therefore tried to figure out what memory overhead 
matplotlib incurs. When I run the following method prior to and after importing 
pylab and matplotlib respectively I get:

def report_memory():
  import os
  pid = os.getpid()
  a2 = os.popen('ps -p %d -o rss,vsz,%%mem' % pid).readlines()
  print a2[1],
  return int(a2[1].split()[1])

import numpy
report_memory()
#import pylab
#import matplotlib
report_memory()

$ python test.py 
 5976  17872  0.5
15608  41924  1.5
$ python test.py 
 5972  17824  0.5
 7608  20608  0.7

I am importing numpy separately since I need it for other purposes. So pylab 
uses ~24 MB while matplotlib uses 2.8 MB. Does this mean that I should rewrite 
my application so that it does not depend on pylab or will the matplotlib 
memory usage ramp up as I import sub modules? What is your experience?

Regards,
Jesper
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to