How to find free resident memory in Linux using python

Sandy dksreddy at gmail.com
Sun Oct 3 11:04:37 EDT 2010


On Oct 2, 10:08 pm, Seebs <usenet-nos... at seebs.net> wrote:
> On 2010-10-02, Sandy <dksre... at gmail.com> wrote:
>
> > I want to find how much free memory (RAM) is available in my system
> > using python.
>
> The question is essentially incoherent on modern systems.  You'd have to
> define terms.  Consider that on a given system, it's quite possible that
> gigabytes of space are being used to cache disk buffers.  Some of those
> could be freed as soon as they get written; some could be freed simply by
> dropping them, since they're just a read cache.  There may be data which
> have been paged out, and will be paged back in as soon as possible -- meaning
> that freeing up space wouldn't actually increase the number of available
> pages of memory for long.
>
> So basically, the question isn't all that well defined.  You can get all
> sorts of numbers.  They may or may not mean anything.
>
> -s
> --
> Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos... at seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
> I am not speaking for my employer, although they do rent some of my opinions.

Thanks all for your suggestions.



More information about the Python-list mailing list