Re: memory_limit Setting?
| From: | Jon Anderson | Date: | Fri, 26 Jan 2007 18:09:13 +0000 |
| Subject: | Re: memory_limit Setting? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247843@lists.php.net to get a copy of this message | ||
Jay Paulson wrote:
Hi everyone, I¹m trying to upload a 25MB file via PHP and I¹m setting the memory limit way high so I don¹t get a fatal error from php (the error is below). What I find really odd about this is that the error message says that PHP tried to allocate almost 54MB. First question is why is PHP allocating so much memory when I¹m only uploading a 25MB file? Question is what does your code look like? AFAIK, PHP uploads files to a temp directory where you can do whatever you want with them. If you don't read them into memory, it won't use a lot of memory (just the overhead required for the $_FILES array).
Second question is why is PHP failing when obviously the memory limit is set to just over 100MB? It's trying to allocate over 50M, but fails because existing memory usage + attempted memory usage is greater than 100M. Call memory_get_usage() right before the line on which it fails to see how much memory is being used by your script.jon