[python-win32] How to calc amount of avail RAM in a process ?

Steven James steven.james at gmail.com
Thu Jan 29 21:59:28 CET 2009


Agreed, but PDH can give per-process statistics, too. For high-memory-usage
apps, I would think that it would be nice for your app to know whether it is
*likely* to need to swap out (by comparing needed memory to availably
physical memory).
Anyway, using the same API, you can determine how much memory space your own
app is currently using, which was the original question. Probably clunky,
but as I said, I'm not an expert.
like so.....
http://soundstripe.net/node/62

Steven

On Thu, Jan 29, 2009 at 2:04 PM, Tim Roberts <timr at probo.com> wrote:

> Steven James wrote:
> > Not an expert on this, but googling "win32 performance counters" led
> > me here:
> >
> > http://msdn.microsoft.com/en-us/library/aa373193(VS.85).aspx
> > <http://msdn.microsoft.com/en-us/library/aa373193%28VS.85%29.aspx>
> >
> > Should let you get the available physical memory in the system. Not
> > sure that you can specify to Windows that you want physical memory
> > when you create the image objects, but it might be OK as a rough guide
> > of whether there is memory available or not.
>
> No, that's useless for this purpose.  Windows is a virtual memory
> system.  Even if you only have 256MB of physical RAM, your process can
> still allocate up to 2GB of memory.
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20090129/e6f9be60/attachment-0001.htm>


More information about the python-win32 mailing list