You may also want to look at the following Summer of Code project: http://pysizer.8325.org/
Their SVN repo is at http://codespeak.net/svn/user/nick8325/sizer/ I haven't had a chance to try it yet, but it might be exactly what you need. The project is described as "PySizer is a library for measuring memory use of Python code" Jay P. -- http://mail.python.org/mailman/listinfo/python-list