Dan Richfield wrote:

> I have created a test script that theoretically loops through a million 
> directories and uses the Dump function in Win32:Perms to produce an array 
> called @AclInfo of all the ACL entries for each directory.  That script is 
> here:
> 
> ===============================

Modified slightly - does this make a difference ? :

use strict;
use warnings;
use Win32::Perms;

my $DirFileObj = new Win32::Perms("C:/test") or die "Perms: $! ($^E)";

# my @AclInfo = ();     # you can try here too instead of inside the loop
for (1 .. 1000000) {
        my @AclInfo = ();
        $DirFileObj->Path("C:/test") or die "Path: $! ($^E)";
        $DirFileObj->Dump([EMAIL PROTECTED]);
}
$DirFileObj->Close();

> ===============================
> 
> The problem is that the Dump function uses more and more memory with each 
> loop iteration without releasing it.  This only happens when you direct the 
> output of Dump to an Array.  If you omit specifying the array 
> ($DirFileObj->Dump()), formatted output is printed to STDOUT and no memory 
> is used.  Because @AclInfo is being re-created on each iteration, memory 
> usage should not build on itself.  I have even attempted destroying the 
> $DirFileObj object and initializing the @AclInfo array (see the 3 commented 
> out lines in the code above) in attempts to reclaim the memory with no 
> success.
> 
> It appears that there is a memory leak in the Win32:Perms module, 
> specifically in the PERMS.DLL (written in C++ I believe).  I have downloaded 
> the source for this module from 
> ftp://www.roth.net/pub/ntperl/perms/20020605/source/Perms_Source.Zip and 
> looked at the XS(XS_WIN32__Perms_Dump) function in PERMS.CPP.  I can see 
> where the ACE hashes that are put into the Dump array are being created, but 
> I am not a C programmer and don't really know how modify this code to 
> reclaim the leaked memory.
> 
> Also, the homepage for the Win32:Perms module is: 
> http://www.roth.net/perl/perms/
_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to