ID: 45644
User updated by: trepseb at hotmail dot com
Reported By: trepseb at hotmail dot com
-Status: Feedback
+Status: Open
Bug Type: Performance problem
Operating System: Linux fedora
PHP Version: 5.2.6
Assigned To: fb-req-jani
New Comment:
Thank you jani. This really was an issue with a debugger extension. I
still don't understand why the "same" debugger does not have a problem
in 32 bit systems and why you would see this as expected behaviour, but
it works now. Maybe this is something for the zend people to analyze.
Until now must developer systems are not 64 bit and it's very difficult
to get to the grounds of this on your server alone.
Previous Comments:
------------------------------------------------------------------------
[2008-07-28 20:17:54] [EMAIL PROTECTED]
# uname -a
Linux linux5 2.6.20-1.2944.fc6 #1 SMP Tue Apr 10 17:46:00 EDT 2007
x86_64 x86_64 x86_64 GNU/Linux
# USE_ZEND_ALLOC=0 php t.php
start 8208
end 8208
# USE_ZEND_ALLOC=1 php t.php
start 92496
end 223888
# USE_ZEND_ALLOC=1 php -n t.php
start 90952
end 94032
Note the last result. The second is with Xdebug enabled.
Do you by any chance have Xdebug (or any other Zend extension) loaded?
If so, this is quite expected behaviour..
------------------------------------------------------------------------
[2008-07-28 12:18:41] trepseb at hotmail dot com
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 this bug report at http://bugs.php.net/?id=45644&edit=1