fread() memory problems

fread() memory problems

am 15.11.2009 20:00:28 von Ashley Sheridan

--=-Iq29++Tmj4dMj3yBpHHf
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I was just wondering why fread() seems to use so much memory when
reading in a file. My php.ini has a script memory limit of 32MB, yet PHP
hits its memory limit on a 19MB mbox file that I'm reading in. How is it
possible that this function can use 150% of a files' size in memory?!


Thanks,
Ash
http://www.ashleysheridan.co.uk



--=-Iq29++Tmj4dMj3yBpHHf--

Re: fread() memory problems

am 16.11.2009 10:13:03 von Peter Ford

Ashley Sheridan wrote:
Ashley Sheridan wrote:
> I was just wondering why fread() seems to use so much memory when
> reading in a file. My php.ini has a script memory limit of 32MB, yet PHP
> hits its memory limit on a 19MB mbox file that I'm reading in. How is it
> possible that this function can use 150% of a files' size in memory?!
>
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

Is it possible that the file is 8-bit characters and your PHP implementation is
converting it to 16-bit characters?
I'm not sure what settings would be involved for that, but no-one else has
responded so I thought a vague idea might be better than nothing!

--
Peter Ford phone: 01580 893333
Developer fax: 01580 893399
Justcroft International Ltd., Staplehurst, Kent

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php