|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-23 23:47 UTC] sniper@php.net
[2005-08-31 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 08:00:01 2025 UTC |
Description: ------------ Replacing items in an array of 20-30 items with str_replace seems to leak memory. The application in question would crash when parsing various larger CSV files, using upwards to >500MB per an 18MB data-file. Jumps in memory usage were observed at the point where str_replace was run. Using the function 'preg_replace' instead issued no such leak Reproduce code: --------------- str_replace('~comma~', ',', $myarray ); Expected result: ---------------- (values of ~comma~ in string were replaced with actual commas) Actual result: -------------- Progress would end indicating in logs that the memory limit of 500MB (as indicated in php.ini) was exceeded.