php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42602 Memory leak occurs when exec() function is used on Windows platform
Submitted: 2007-09-09 09:37 UTC Modified: 2007-09-12 10:05 UTC
From: melmack3 at gmail dot com Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 5.2.4 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: melmack3 at gmail dot com
New email:
PHP Version: OS:

 

 [2007-09-09 09:37 UTC] melmack3 at gmail dot com
Description:
------------
A simple PHP script (attached below) which executes empty Windows batch file 1000 times causes ~10 MB memory leak.

Reproduce code:
---------------
<?php

for($i=0;$i<1000;$i++)
{
  exec("test.bat");
}

?>

//test.bat is just an empty file.

Expected result:
----------------
Batch file "test.bat" should be executed 1000 times and amount of used memory should not increase when PHP script has finished.

Actual result:
--------------
Batch file is executed properly but PHP script causes about 10 MB memory leak. It can be observed by usage of performance system monitor. However, this amount of memory is not taken by a certain process - it simply disappears. PHP function memory_get_usage() also does not indicate the leak.  

Memory leak is observable only on Windows platform 
(tested on Windows XP). On Linux everything works OK.

This problems occurs in all available enviroments :
- IIS Webserver.
- Apache webserver
- PHP command line interpreter

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-09 10:12 UTC] jani@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 [2007-09-12 10:05 UTC] jani@php.net
comment from melmack via email:

"You were right. I have fixed the problem.
The problem was caused by an additional firewall installed on both computers with Windows XP used by me for testing process. When I uninstalled it, the problem disappeared."

Apparently the firewall prevented running the scripts and left the cmd.exe hanging around..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 12:01:27 2024 UTC