Show us some code and we might be able to help you.
Allowed memory size of 134217728 bytes exhausted
Hi, I have the following error when i register a user:
{message: "Allowed memory size of 134217728 bytes exhausted (tried to allocate 71073600 bytes)",…}
exception: "Symfony\Component\Debug\Exception\FatalErrorException"
file: "E:\Projects\test\listico\vendor\intervention\image\src\Intervention\Image\Gd\Decoder.php"
line: 30
message: "Allowed memory size of 134217728 bytes exhausted (tried to allocate 71073600 bytes)"
trace: []
I know that i have reached the memory limit and i have run out of memory i understand that i have to raise the memory limit in php.ini file, but i am worried how is that possible? I have tried to upload 2 images each image exactly 527kb so altogether around 1 mb and i have about 30 text type input field. So I just dont get it how is it possible to reach the 134 mb limit? Any thoughts? I send all the data to back end with axios. Is it normal? or i have done something terribly wrong with my code?
Thanks for any advice.
Ah, you're using Intervention to do some stuff.
$thumb = Image::make($logo);
$thumb->fit(200);
$jpg = (string) $thumb->encode('jpg');
$thumbName = pathinfo($logoname, PATHINFO_FILENAME).'-thumb.jpg';
Storage::disk('s3')->put($thumbName, $jpg, 'public');
$thumb->destroy(); // free the memory that intervention was using
unset($jpg); // same here since it contains the entire jpg as a string
After you're done saving the image(s), destroy() them so it will free up the resources it was using. http://image.intervention.io/api/destroy
Please or to participate in this conversation.