Possible Duplicate:
How to get current CPU and RAM usage in Python?
How can I get the available and currently used memory from Python? It need to be cross-platform and at least work on at least Windows, Mac OS X and Linux.
I'd like to report the user in my application that he doesn't have enough memory free to proceed and do the next operation.
try: ... except MemoryError: ...
MemoryError
, the state of the interpreter is unreliable and liable to have incorrect info and/or simply fail.