From:             trepseb at hotmail dot com
Operating system: Linux fedora
PHP version:      5.2.6
PHP Bug Type:     Performance problem
Bug description:  eval memory leak (mybe due to underlying libraries)

Description:
------------
We were using eval extensivly for making a dynamic code parser. It used to
be all ok till we needed to use it for more than 30000 iterations. Suddenly
our memory limit was reached. We tracked it down to the underlying code.

Strangely this is only an issue with 64 Bit systems. A PowerMac Dual has
this Problem the same as a 8 Core XEON. The INTEL and AMD with 32 bits
don't have a Problem, here the script requires no additional memory with
each cycle.

Probably this has to do with some underlying library, but maybe you can
figure out which.

Here is a part of my php info

Linux ******** 2.6.23.17-88.fc7 #1 SMP Thu May 15 00:02:29 EDT 2008
x86_64
Build Date      May 8 2008 08:38:49
Configure Command       './configure' '--build=x86_64-redhat-linux-gnu'
'--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu'
'--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64'
'--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache'
'--with-libdir=lib64' '--with-config-file-path=/etc'
'--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic'
'--disable-rpath' '--without-pear' '--with-bz2' '--with-curl'
'--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr'
'--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp'
'--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png'
'--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr'
'--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp'
'--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem'
'--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars'
'--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos'
'--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr'
'--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx'
'--enable-dio' '--without-mime-magic' '--without-sqlite'
'--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata'
'--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd'
'--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC'
'--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter'
'--disable-json'


I checked the other eval errors, but they did not have much to do with
mine, and they are all stone old ;).

Reproduce code:
---------------
echo "start ".memory_get_usage()."\n";

$aData['an_anfrage_art'] = '150';

$aData['ega_codes'] = '12|13|15|17|18|23';

for ($i=0;$i<100000;$i++){

   eval('$bCondition = !in_array( \'150\' , array(12,13,15,17,18,23));');

}

echo "end ".memory_get_usage();

Expected result:
----------------
start 46592 
end 47980

32 bit system. This is the expected result the memory usage is constant
with more cycles

Actual result:
--------------
start 78488
end 1710444

64 bit system. Here the memory usage is growing linearly. More cycles make
the memory consumption grow. 

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

Reply via email to