The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

no warnings;
################################################################################
sub memory_usage {
my $processes = $main::winmgmts_cimv2_object -> ExecQuery ("select * from Win32_Process where ProcessId=$$");
foreach my $proc (Win32::OLE::in ($processes)) {
return $proc -> {WorkingSetSize};
}
};
################################################################################
BEGIN {
require Win32::OLE;
$main::winmgmts_cimv2_object ||= Win32::OLE -> GetObject ('winmgmts:\\\\.\\root\\cimv2');
print STDERR 'Win32 OLE';
}
1;