[rt.cpan.org #48490] Memory leak in Win32::perflib

[email protected] ("Vassili Gorshkov via RT")
Newsgroups perl.libwin32
Message-ID <[email protected]>
Thu Aug 06 09:26:02 2009: Request 48490 was acted upon.
Transaction: Ticket created by [email protected]
       Queue: Win32-PerfLib
     Subject: Memory leak in Win32::perflib
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: [email protected]
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48490 >


Hi,
We have run into a memory leaks when accessing performance counters using
Win32::perflib library.  Interestingly enough the memory leak only occurs
when getting network counters.  The following small test case demonstrates
the problem:

use Win32::PerfLib;

my $perflib  = new Win32::PerfLib("");

my $obj = 510; # 230 - proc stat and 510 - network stat

while(1) {
        my $proc_ref = {};
        $perflib->GetObjectList($obj, $proc_ref);
        $perflib->Close($proc_ref));
}


The test case above leaks 100KB/s.  Note that if you change $obj from 510
(network) to 230 (process), the leak goes away.


We are running active perl version 5.10.0 built for MSWin32-x86-multi-thread
(with 5 registered patches).

OS: Windows XP Professional.

Thanks,

Vassili
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.