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/10/26 00:10:35 UTC

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.