|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-06-24 01:56 UTC] stas at cvs dot php dot net
[2000-07-24 09:05 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 13 07:00:01 2026 UTC |
while ( substr($linein = fgets($fs, 4096), 0, 1) != '.' ) { $group_list[] = $linein; } This particular bit of code is used to read in a usenet message id listing, each item is 8 characters long (8 bytes??) The memory usage grows to ridiculous length, for example 11k elements take up 43 megs on my linux 2.2.16 and freebsd 3.2. I've been able to hack around the problem using substr like this: while ( substr($linein = fgets($fs, 4096), 0, 1) != '.' ) { $group_list[] = substr($linein, 0, strlen($linein)); } this decreased the memory usage to about 4 megs, by a factor of ~10.