How do I find the memory used by a python process

Ben Finney bignose+hates-spam at benfinney.id.au
Mon Nov 3 16:50:10 EST 2008


Salim Fadhley <salimfadhley at gmail.com> writes:

> The unit-test needs to check that after the functions have been run
> a few thousand times all of the memory used by those functions has
> been un-allocated, i.e. that there are no memory leaks.

This is a great test case, thanks. I must add it to my store of
generally-applicable unit test cases.

However, I wonder why you specify the need to run the function
*thousands* of times to test whether it releases memory. Surely your
code unit is deterministic and will release memory (or not) the same
way with the same inputs each time?

-- 
 \       “The right to use [strong cryptography] is the right to speak |
  `\                                             Navajo.” —Eben Moglen |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list