Getting the info for the current process with Win32::Process::Info just requires you pass the current pid ($$) to GetProcInfo(). The hash returned (as the first element of the array) contains the following keys. I've indicated the keys that relate to the figures shown in the task manager/pslist:

perl> use Win32::Process::Info;; perl> $p = Win32::Process::Info->new;; perl> @i = $p->GetProcInfo( $$ );; perl> $h = $i[0];; perl> print "$_ => ", $h->{ $_ } || 'n/a' for keys %$h;; TerminationDate => n/a QuotaNonPagedPoolUsage => 3800 ParentProcessId => 1172 Status => n/a OSName => Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddi +sk0\Partition1 CSName => D4KG9X0J PeakPageFileUsage => 5103616 PageFileUsage => 4186112 QuotaPeakNonPagedPoolUsage => 3920 WorkingSetSize => 3887104 .......## This is the tasklist "Mem Usage" +figure. CreationDate => 1130168062 HandleCount => 103 WindowsVersion => 5.1.2600 PeakWorkingSetSize => 7254016 MaximumWorkingSetSize => 1413120 PeakVirtualSize => 142602240 WriteOperationCount => 2 SessionId => n/a PrivatePageCount => 4186112 .....## This is the tasklist "VM Size" fi +gure Owner => D4KG9X0J\Me ProcessId => 188 Caption => perl.exe CommandLine => c:\perl\bin\perl.exe -sw "c:\Perl\bin\p1.pl" OSCreationClassName => Win32_OperatingSystem Priority => 8 MinimumWorkingSetSize => 204800 CreationClassName => Win32_Process ThreadCount => 7 KernelModeTime => 0.328125 ExecutionState => n/a CSCreationClassName => Win32_ComputerSystem InstallDate => n/a WriteTransferCount => 144 OtherTransferCount => 203274 PageFaults => 2758 VirtualSize => 142602240 QuotaPagedPoolUsage => 25776 OwnerSid => S-1-5-21-756011271-1152625135-639526082-1005 ReadTransferCount => 347129 OtherOperationCount => 3358 ReadOperationCount => 171 QuotaPeakPagedPoolUsage => 25808 ExecutablePath => c:\perl\bin\perl.exe UserModeTime => 0.265625 Name => perl.exe Description => perl.exe Handle => 188

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Tracking memory of a running application by BrowserUk
in thread Tracking memory of a running application by DrWhy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.