There is Win32::SystemInfo where you can track memory. But that only works if
you don't have a leak but a sinking ship :). From the POD:
MemoryStatus
Win32::SystemInfo::MemoryStatus(%mHash,[$format]);
%mHash - The hash that will receive the results.
Certain values can be set prior to the
call to retrieve a subset. (See below)
$format - Optional parameter. Used to set the order
of magnitude of the results. (See below)
Determines the current memory status of a Win32 machine. Populates
%mHash with the results. Function returns undef on failure.
Values returned through the hash:
MemLoad - Windows NT 3.1 to 4.0: The percentage of
approximately the last 1000 pages of physical
memory that is in use.
- Windows 2000: The approximate percentage of
total physical memory that is in use.
TotalPhys - Total amount of physical memory (RAM).
AvailPhys - Available physical memory (RAM).
TotalPage - Allocated size of page (swap) file.
AvailPage - Available page file memory.
TotalVirtual - Total physical + maximum page file.
AvailVirtual - Total amount of available memory.
Values returned through the hash can also be specified by setting
them before the function is called.
my %mHash = (TotalPhys => 0);
Win32::MemoryInfo::MemoryStatus(%mHash);
Will return only the total physical memory.
MemoryStatus return values in bytes by default. This can be changed with
the $format parameter. Valid values for $format are:
B - Bytes (default)
KB - Kilobytes
MB - Megabytes
GB - Gigabytes
Citeren Steve Loughran <[EMAIL PROTECTED]>:
> Hi all
>
> Not strictly a win32-gui related question. How would I go about tracking
> down my memory usage in a perl script? I have a small memory leak in my
> code somewhere, but no idea where to start looking for clues.
>
> Anyone got any pointers or tips?
>
> Steve
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.