CPU/Memory usage of a process on Windows machine
- From: jeevan.ingale@xxxxxxxxx (Jeevs)
- Date: Thu, 28 Jun 2007 23:11:41 -0700
Greetings
I am trying to find CPU and memory usage on a windows machine and i
was able to get through memory usage using Win32::Process::Info
module's GetProcInfo function.
This code may be helpfull to others which calculate the memory usage
of a particular process on windows
#!c:/perl/bin/perl.exe
# This is a test scrip
use Win32::Process::Info;
use warnings;
use strict;
my $pi = Win32::Process::Info->new ();
my @process_information = $pi->GetProcInfo(4488); ## 4488 is pid of a
particular process.
foreach $info (@process_information) {
foreach my $key (keys %{$info}) {
if ($key eq "WorkingSetSize") {
my $value = ${$info}{$key}/1024;
print "$key:=>$value \n"
}
}
}
However i am struck at the cpu usage part.. If anyone can point me to
some good article or any docs to read for the same would be
appreciated. I have already googled a lot but i think i am missing
something..
Thanks ..
.
- Follow-Ups:
- Re: CPU/Memory usage of a process on Windows machine
- From: Oryann9
- Re: CPU/Memory usage of a process on Windows machine
- From: Oryann9
- Re: CPU/Memory usage of a process on Windows machine
- Prev by Date: Spread*** IO::Scalar v. PerlIO::Scalar confusion
- Next by Date: Re: processing XL using Win32::OLE
- Previous by thread: Spread*** IO::Scalar v. PerlIO::Scalar confusion
- Next by thread: Re: CPU/Memory usage of a process on Windows machine
- Index(es):