I believe I have resolved the memory leak in PERMS.DLL, however, I am having
major problems trying to compile the DLL. Taking my changes out of the mix
and just attempting to compile the source of perms.dll
(ftp://www.roth.net/pub/ntperl/perms/20020605/source/Perms_Source.Zip) does
not work either.
I have done the following:
- installed Visual Studio 6.0
- downloaded the activestate activeperl 5.6.1 source
(http://aspn.activestate.com/ASPN/Downloads/ActivePerl/Source)
- added the activeperl source directory to Visual Studio in Tools ->
Options -> Directories
- copied various files/folders from the perl source to the perms.dll source
root directory to accomodate for missing files during the build.
After all of that, I am still getting errors during the build for files such
as config.h, file.h, etc..
So my question as of now is simply, how do I compile the perms.dll source
into a DLL? I am willing to use any compiler or method other than Visual
Studio.
I will post my resolution once I can compile this DLL and test it to make
sure it works.
Thanks,
Dan
----- Original Message -----
From: "Dan Richfield" <[EMAIL PROTECTED]>
To: <perl-win32-admin@listserv.ActiveState.com>
Sent: Friday, February 24, 2006 6:19 PM
Subject: Win32::Perms Dump function Memory Leak
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:
===============================
$DirFileObj = new Win32::Perms("C:/test") ||
die(Win32::FormatMessage(Win32::GetLastError()));
for ($i = 0; $i <= 1000000; $i++) {
$DirFileObj->Path("C:/test") ||
die(Win32::FormatMessage(Win32::GetLastError()));
$DirFileObj->Dump([EMAIL PROTECTED]) ||
die(Win32::FormatMessage(Win32::GetLastError()));
# $DirFileObj->Close();
# @AclInfo = ();
# undef @AclInfo;
}
===============================
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/
Thanks,
Dan
_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs