Observing memory usage for python programs

Several times already, I wish I could observe the memory usage of some python scripts/modules, and more importantly, which portion is consumed in which objects. For C/python problems, I’ve used massif from valgrind, but this is not alway usable. On the bzr ML, several alternatives have been suggested:

  1. reducing-the-footprint-of-python-applications
  2. Heapy
  3. Another solution which requires recompiling the python interpreter: see here. Unfortunately, numpy does not work with an interpreter compiled with this (at least on linux).

Will try those methods when I will have some more time, and report a bit in more details

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s