You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Harshy Wanigasekara <Ha...@Omneon.com> on 2000/11/01 21:38:47 UTC
RE: memory leak under WinNT - fixed
Hi again,
We managed to fix the problem described
below. The issue was the win32
porting code in perl. In the file
perl-5.6.0/win32/win32.h
commenting out the line:
#define ENV_IS_CASELESS
fixes the memory leak problem.
-harshy
> -----Original Message-----
> From: Harshy Wanigasekara
> Sent: Wednesday, October 25, 2000 3:11 PM
> To: modperl@apache.org
> Subject: memory leak under WinNT
>
>
> Hi All,
>
> I've looked through the maillist archives,
> and FAQs and guides and docs, with no help.
>
> I've got a memory leak problem running embedded
> perl under Apache on Windows NT. I've reduced
> the problem set as much as I can, to the
> following Apache::Registry script:
> ---------------
> # Filename: test.pl
> print("<html>
> <head>
> <title>Apache test</title>
> </head>
> </body>
> Hello world.
> <script LANGUAGE=\"JavaScript\">
> function ReloadPageFunc()
> {
> var newloc = \"test.pl\";
> window.location.href = newloc;
> }
> var myTimeOut = setTimeout(\"ReloadPageFunc()\", 10000);
> </script>
> </body>
> </html>\n");
> ----------------
> The script just generates a page which causes the
> browser to reload the same page every 10 seconds.
> The browser has no complaints about the page it receives.
> When I leave this page running I get memory leaks in
> the apache process.
>
> If I remove the enclosing print(""); statement so I
> just have the HTML code in a test.html file
> (ie: Apache::Registry handler is NOT called), there
> are no memory leaks.
>
> In the above example, the apache process' memory usage
> keeps increasing continuously until all virtual memory
> is exhausted (~1 GByte). I see 32K byte jumps for
> about every 100 reloads, it's worse for more complicated
> scripts. Since this is Windoze, I can't limit the number
> of requests a child can handle.
>
> My setup:
> Windows NT 4.0 SP 5
> Apache 1.3.12
> Perl 5.6.0
> Modperl 1.24
> (also embperl 1.3b5, but not used in above example)
> All source code compiled with VC++ 6.0
>
> I ran BoundsChecker on the apache executable in the
> hopes of finding a single culprit, but found a
> multitude of perl core routines allocate memory using
> win32_malloc() in /perl5.6.0/win32/win32.c and
> don't free it.
>
> Anyone seen this before?
>
> -harshy
> --
> Harshy Wanigasekara, Omneon Video Networks.
>