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

Tim Roberts timr at probo.com
Thu Jan 29 20:04:23 CET 2009


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.



More information about the python-win32 mailing list