RE: memory leak in win32

2000-12-13 Thread Harshy Wanigasekara

Son Chang wrote:
Hi,

I'm experiencing a memory leak with Apache 1.3.14 with mod_perl 1.23 and
perl5.6.0 on Windows NT4.0 and Windows2000.
I've been running some test with a very simple ModPerl handler which just
outputs an HTML page with hello world in it.  Also, I made sure to undef
all
variables that I use.
In general, the child processes grow with each request.
Also, if I set MaxRequestsPerChild to 20 so the child process dies and
restarts after every 20 request, this fixes the problem for the child
processes.  However, with this configuration, there's a memory leak
problem with the parent process.  After the child process dies and
restarts, the parent process grows in size.  This happens every time the
child process dies and restarts.
So with either configuration, I have a memory leak problem.
What can I do to fix this problem?

-son

Heh, I just unsubscribed from the mailing list,
almost missed your question.

We ran into the exact same problem here.

Try:

http://forum.swarthmore.edu/epigone/modperl/groxbloiglim/03AB3CB11CBED3118A4
F009027B0C2B16B71A4@HAPPY

Our fix stops the child process growing, but not the parent.

-harshy

-- 
Harshy Wanigasekara, Software guy, Omneon Video Networks.



RE: memory leak under WinNT - fixed

2000-11-01 Thread Harshy Wanigasekara

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: [EMAIL PROTECTED]
 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
   titleApache test/title
 /head
 /body
 Hello world.
 script LANGUAGE=\"JavaScript\"
   function ReloadPageFunc()
   {
   var newloc = \"test.pl\";
   window.location.href = newloc;
   }
   var myTimeOut = setTimeout(\"ReloadPageFunc()\", 1);
 /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.