Quantcast

WMI to find private memory usage

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

WMI to find private memory usage

Riz Hossain
Hello,

I am looking for a way to capture the private memory usage by a process (the one that shows on task manager).  I searched online a lot but I am only seeing information on working memory size.  It would be also a great if I could get the peak value of private memory usage.

Thanks,
Riz 


for process in c:
    if process.Caption.lower() == 'rimdevicemanager.exe':
        keys = process.properties.keys()
        keys.sort()
        print '\n'.join(['%s: %s' % (key, getattr(process, key)) for key in keys])
--


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

_______________________________________________
python-win32 mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-win32
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WMI to find private memory usage

Tim Golden-4
On 13/04/2012 16:22, Riz Hossain wrote:
> Hello,
>
> I am looking for a way to capture the private memory usage by a process
> (the one that shows on task manager).  I searched online a lot but I am
> only seeing information on working memory size.  It would be also a
> great if I could get the peak value of private memory usage.

While I've never done what you're describing, the first place
I'd look is psutil:

  http://code.google.com/p/psutil/

TJG
_______________________________________________
python-win32 mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-win32
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WMI to find private memory usage

Riz Hossain
Thanks for the reply Tim.

I have tried the below code:

import psutil
p = psutil.Process(3540)
print p.get_memory_info()


it outputs:
meminfo(rss=157237248, vms=139837440)

which is the memory for working set and  commit.  This is still not returning me the private value (which is what you see on your task manager).

Thanks,
Riz 

On Fri, Apr 13, 2012 at 11:26 AM, Tim Golden <[hidden email]> wrote:
On 13/04/2012 16:22, Riz Hossain wrote:
> Hello,
>
> I am looking for a way to capture the private memory usage by a process
> (the one that shows on task manager).  I searched online a lot but I am
> only seeing information on working memory size.  It would be also a
> great if I could get the peak value of private memory usage.

While I've never done what you're describing, the first place
I'd look is psutil:

 http://code.google.com/p/psutil/

TJG
_______________________________________________
python-win32 mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-win32



--

Riz Hossain
Engineering Physics (B.Eng)
Software Test Specialist
Research In Motion
295 Phillip Street
Waterloo, ON N2L 3L3


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

_______________________________________________
python-win32 mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-win32
Loading...