Re: Leak in Win32::ChangeNotify?

From: Matt Garrish (matthew.garrish_at_sympatico.ca)
Date: 12/29/04


Date: Tue, 28 Dec 2004 19:56:30 -0500


"Thomas Kratz" <ThomasKratz@REMOVEwebCAPS.de> wrote in message
news:41d170e7$0$776$bb690d87@news.main-rheiner.de...
> The code below is a simple example of using Win32::ChangeNotify. AFAIK
> this is how it should be used according to the docs.
> If you run this you will see a steady increase in the used nonpage pool
> memory of the perl process in the Win32 performance monitor (Category
> 'Process', counter 'Pool Nonpaged Bytes'). Changing the file will result
> in the notification message printed to screen as well as in more memory
> leaking. After the second change it will go berserk and if you don't
> terminate the process quickly it will eat up all the systems nonpaged pool
> memory and thus cause serious trouble elsewhere in the system.
>
> Moving the object creation into the while loop and deleting the line with
> '$notify->reset()' works around the problem.
>
> Can somebody confirm this? If yes I will file a bug report on rt.cpan.org.
>

Strange. The first time I ran the script the nonpaged memory slowly grew
(nothing like what you describe, though). I let it run up from ~10100K to
~11500K before killing script (at which point it dropped right back to where
it started), but on subsequent restarts could not get the script to leak
again (it stayed steady at ~10100 no matter what I did to the file).

This was on XP Pro using v5.8.2.

Matt