|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-11-08 20:33 UTC] nikolas dot hagelstein at gmail dot com
Description: ------------ After upgrading to php 5.2.0 im constantly receiving "PHP Fatal error: Out of memory error" where i did not received one using 5.1.6. I adjusted the memory limit from 64M to 256M but without any success. PHP Fatal error: Out of memory (allocated 250871808) at /usr/pkgsrc/www/ap-php/work/php-5.2.0/ext/standard/var.c:541 (tried to allocate 2215827 bytes) in /var/www/shared/typo3_src-4.0.1/typo3/mod/tools/em/class.em_xmlhandler.php on line 141, referer: http://www.chaosbutze.de/typo3/mod/tools/em/index.php? i am not sure about how to dig into this but i can say that it seems to be somehow xml/serialize related. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
<?php $i=0; $test2=array( 'a1_teasermenu' => array( 'downloadcounter' => 2777, 'versions' => array( '0.1.0' => array ( 'title' => 'A1 Teasermenu', 'description' => 'Displays a teaser for advanced subpages or a selection of advanced pages', 'state' => 'stable', 'reviewstate' => 0, 'category' => 'plugin', 'downloadcounter' => 2787, 'lastuploaddate' => 1088427240, 'dependencies' => array ( 'depends' => array( 'typo3' =>'', 'php' =>'', 'cms' => '' ), 'conflicts' => array('' =>'') ), 'authorname' => 'Mirko Balluff', 'authoremail' => 'balluff@amt1.de', 'ownerusername' => 'amt1', 't3xfilemd5' => '3a4ec198b6ea8d0bc2d69d9b7400398f', ) ) ) ); $test=array(); while($i<1600) { $test[]=$test2; $i++; } $out=gzcompress(serialize($test)); ?> results in : PHP Fatal error: Allowed memory size of 67108864 bytes exhausted at /usr/pkgsrc/lang/php5/work/php-5.2.0/ext/standard/var.c:541 (tried to allocate 1041720 bytes) in /var/www/www.chaosbutze.de/htdocs/test2.php on line 37 while it works on php 5.1.6 and 4. Having mem limit set to 64MB. Setting mem limit to 128MB and increasing interations to 2260 also causes the above mentioned error.I withdraw my previous comment, the RC3-build was without "--enable-memory-limit". Sorry. I've found that --------------------------------------- <?php $i = 0; $a = array(); while( $i++ < 100000 ) { $a[] = 'a'; } echo memory_get_usage(); ?> --------------------------------------- uses a lot more memory. I cannot say, if this is because of the more accurate memory manager reporting. I'm surprised how much memory is needed for 100.000 "a"'s in an array.. $ php -f test2.php 9494860 daniel@base [stp:2] { ~/bugs/php/memoryusage } $ php5 -f test2.php 6967216 -------- $ php -v PHP 5.2.1-dev (cli) (built: Nov 27 2006 03:16:44) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies $ php5 -v PHP 5.1.6 (cli) (built: Nov 2 2006 12:49:10) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies