mschrank99 Posted October 25, 2006 Share Posted October 25, 2006 For some reason, uploads are taking up much more memory than the actual file size. For example, I tried to upload a 640K jpg and I set a memory limit per script of 12MB, and that file made the script go over the limit and it crashed. ???Why are file uploads of 640KB making my script use up more than the 12 meg limit and crash? Is there any way to fix this, short of restricting the file size people can upload?-Matthew Quote Link to comment https://forums.phpfreaks.com/topic/25085-file-uploading-taking-up-large-amounts-of-memory/ Share on other sites More sharing options...
HuggieBear Posted October 25, 2006 Share Posted October 25, 2006 I don't know why, but I had the same problem, it's possibly a memory leak issue.Add the following to the top of your page:[code]<?phpini_set("memory_limit", "50M");ini_set("max_execution_time", "120");?>[/code]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/25085-file-uploading-taking-up-large-amounts-of-memory/#findComment-114373 Share on other sites More sharing options...
mschrank99 Posted October 25, 2006 Author Share Posted October 25, 2006 Yes, but if I set the memory to 50M, wouldn't it crash my server (or at least bring it to its knees) if more than a few people were using it at the same time?But in any case, it's not normal for a 512kb file to hog up over 12 megs of ram right? Quote Link to comment https://forums.phpfreaks.com/topic/25085-file-uploading-taking-up-large-amounts-of-memory/#findComment-114394 Share on other sites More sharing options...
HuggieBear Posted October 25, 2006 Share Posted October 25, 2006 I think it is normal when uploading. I don't know why, and I had hoped somebody would explain to me when I posted the same question here two weeks ago, but no joy.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/25085-file-uploading-taking-up-large-amounts-of-memory/#findComment-114499 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.