I am using the following perl program which uses WMI class Win32_Process to determine memory usage of a process
use strict;
use warnings;
use Win32::OLE qw/in/;
sub memory_usage()
{
my $objWMI = Win32::OLE->GetObject('winmgmts:\\\\.\\root\\cimv2');
my $processes = $objWMI->ExecQuery("select * from Win32_Process where Name=\'notepad.exe\'");
my $memory = 0;
foreach my $proc (in($processes))
{
$memory = $memory + $proc->{WorkingSetSize};
}
return $memory;
}
print 'Memory usage: ', memory_usage(), "\n";
WMI class Win32_Process and its properties are given on MSDN here
Problem is that it calculates Working Set Memory and i want to calculate Private Working set memory, for which no property is defined on the linked page
Is there some way i can calculate Private Working set memory from this class?