|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-30 13:14 UTC] tony2001@php.net
[2007-05-08 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 21:00:01 2025 UTC |
Description: ------------ when using serialize on some large (not huge) array, it will take insane amounts of memory. look at the code , when using size array of 30,000 , the script works as expected, indicating that the output is a mere 2MB in length, while enlarging the array to 50,000 elements causes php to go crazy and hit the 600MB i've allowed him to consume... Reproduce code: --------------- <? $a = array(); for($i=0;$i<50000;$i++) { $a[$i] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; } $z = serialize($a); print strlen($z); ?>