snivek Posted January 9, 2007 Share Posted January 9, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/33480-solved-memory-problem/ Share on other sites More sharing options...
Jessica Posted January 9, 2007 Share Posted January 9, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/33480-solved-memory-problem/#findComment-156701 Share on other sites More sharing options...
HuggieBear Posted January 9, 2007 Share Posted January 9, 2007 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 memoryini_set("memory_limit","50M");?>[/code]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/33480-solved-memory-problem/#findComment-156709 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.