From:             tim at digicol dot de
Operating system: Linux (Debian 4.0 x86)
PHP version:      5.3CVS-2009-01-08 (snap)
PHP Bug Type:     Scripting Engine problem
Bug description:  Memory leak in include()

Description:
------------
With today's PHP 5.3 snapshot, include() on my Linux box leaks memory; 
I've noticed this because we're using long-running scripts with the 
PHP CLI (where Smarty's fetch/display methods call include()...). This 
doesn't happen with PHP 5.2.6.

I tested with an unchanged copy of php.ini-recommended and just 
'./configure' without any options, on Debian Linux 4.0, running in 
VMware Fusion on my Intel Mac.

Thanks for looking into this, and for the great work on PHP!

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

// Create an empty file
touch('empty.txt');

while (true)
{
    include('empty.txt');
    echo memory_get_usage() . "\n";
}

?>

Expected result:
----------------
No increase in memory usage.

Actual result:
--------------
Memory usage increases constantly, until PHP exits because the memory 
limit is exceeded.

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

Reply via email to