From:             melmack3 at gmail dot com
Operating system: Windows XP
PHP version:      5.2.4
PHP Bug Type:     Performance problem
Bug description:  Memory leak occurs when exec() function is used on Windows 
platform

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

-- 
Edit bug report at http://bugs.php.net/?id=42602&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42602&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42602&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42602&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42602&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42602&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42602&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42602&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42602&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42602&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42602&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42602&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42602&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42602&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42602&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42602&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42602&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42602&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42602&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42602&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42602&r=mysqlcfg

Reply via email to