2

Possible Duplicate:
How to get current CPU and RAM usage in Python?

Is there a way to get the free memory of the system, using python? os and sys don't seem to expose this sort of functionality.

Obviously, one could use subprocess or os.system, but it wouldn't be portable, nor reliable without serious testing.

Community
  • 1
  • 1
loopbackbee
  • 21,962
  • 10
  • 62
  • 97
  • 1
    AFAIK it's not in the standard library, so you'll need to code a platform-specific version for each platform, or use a third-party module. – nneonneo Jan 30 '13 at 21:16
  • I think a useful starting point would be to define what precisely you mean by "free memory". – NPE Jan 30 '13 at 21:17
  • I think this thread might be useful: http://stackoverflow.com/questions/276052/how-to-get-current-cpu-and-ram-usage-in-python, or http://stackoverflow.com/questions/1204378/getting-total-free-ram-from-within-python – bhamby Jan 30 '13 at 21:17
  • Take a look at the psutil library. It is mentioned (with links) in the duplicate questions found by @bhamby. – Warren Weckesser Jan 30 '13 at 21:22
  • Indeed, it's a duplicate, sorry about that – loopbackbee Jan 30 '13 at 21:25
  • @NPE not counting buffers, if that's what you mean – loopbackbee Jan 30 '13 at 21:25

0 Answers0