Re: HUGE memory consumption on fread()
| From: | Andrey Hristov | Date: | Wed, 14 Aug 2002 12:24:41 +0000 |
| Subject: | Re: HUGE memory consumption on fread() | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-86819@lists.php.net to get a copy of this message | ||
>
> Once you've eliminated that problem, I'd suggest that you
> use readfile() instead of manually looping; readfile should
> be much kinder to your hardware as it uses mmap, which means
> that PHP doesn't need to keep allocating small buffers in the loop,
> and that the OS can potentially share the mapped memory between
> clients (which makes a lot of sense for you!).
>
Does this mean that if I readfile() a file in one script and after it's end
the same script is invoked it will read from the memory instead of disk i/o?
Andrey