Jump to content

[SOLVED] Allowed memory size of X bytes exhausted (tried to allocate Y bytes)


Recommended Posts

I am receiving this error message when using certain modules:

Allowed memory size of X bytes exhausted (tried to allocate Y bytes)

 

Where Y is much less than X, for example:

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 9088 bytes) in [...]

 

When using  imagecreatefromjpeg() on a file over 1mb (The 9088 always seems to be the same).

 

I checked the machine, and it looks like someone else has seen this problem before because the max memory limit is set to 128MB.

 

Anyone know what is going on here?

 

Thanks for any help.

Link to comment
Share on other sites

I guess the problem turned out to be the dimensions of the image I was using. Even though the actual disk size of the image wasn't that large, imagecreatefromjpeg() needed a lot of space in memory for all those pixels! I'm not sure why the max memory wasn't changing when I adjusted it in php.ini, but it worked when I set it with ini_set().

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.