Jump to content

Archived

This topic is now archived and is closed to further replies.

mschrank99

File uploading taking up large amounts of memory

Recommended Posts

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

Share this post


Link to post
Share on other sites
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]
<?php
ini_set("memory_limit", "50M");
ini_set("max_execution_time", "120");
?>
[/code]

Regards
Huggie

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Regards
Huggie

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.