Jump to content

[SOLVED] Memory Problem


snivek

Recommended Posts

I am getting an out of memory error when I call imagecreatefromjpeg().  I am providing it with a 1MB image.  Per my php.ini i have 20MB allocated to me.  Does this function use a lot more memory than I think?  Are there any PHP function I can use to get the amount of memory a variable or array is using?  Like $memused = Mem($string);  Thanks!
Link to comment
https://forums.phpfreaks.com/topic/33480-solved-memory-problem/
Share on other sites

You can use ini_set to temporarily raise the memory limit - I've found whenever I have these problems, there's something more behind it - I was getting one yesterday and after a half hour of messing with it I found my infinite loop. You might wanna double check for that sort of thing.
Link to comment
https://forums.phpfreaks.com/topic/33480-solved-memory-problem/#findComment-156701
Share on other sites

Yes, you're underestimating how much memory it uses...  Increase the memory to something like 50MB using ini_set() as suggested by Jesi.

Take a look [url=http://www.libgd.org/FAQ_PHP#Why_does_gd_cause_my_PHP_script_to_run_out_of_memory.3F]here[/url]

[code]<?php
// Increase available memory
ini_set("memory_limit","50M");
?>[/code]

Regards
Huggie
Link to comment
https://forums.phpfreaks.com/topic/33480-solved-memory-problem/#findComment-156709
Share on other sites

Archived

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

×
×
  • Create New...

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.