OutOfMemoryException occurred when uploading file using Symfony - symfony

I have followed the instructions in the Symfony documentation for how to upload a file exactly as per https://symfony.com/doc/current/controller/upload_file.html.
However when I post the file using Postman I get an OutOfMemoryException. Does anyone know what causes this and how to fix it?
The error received is as follows:
(1/1) OutOfMemoryException
Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 109056000 bytes)

In your php.ini change configuration
upload_max_filesize = 2M
also, check
post_max_size = 8M
change this configuration ...
restart server and check

Related

Only home page of wordpress is not opening, memory allocate error Wordpress

only homepage of my website is not opening, showing error:
This page isn’t working www.domain.com redirected you too many times.
in errors log I can see:
[19-Nov-2021 05:17:54 UTC] PHP Fatal error: Out of memory (allocated 193462272) (tried to allocate 16384 bytes) in /hermes/walnacweb07/walnacweb07an/b413/hoc.mwtinccom/wp-includes/media.php on line 3653
[19-Nov-2021 05:17:54 UTC] PHP Fatal error: Out of memory (allocated 193462272) (tried to allocate 65536 bytes) in /hermes/walnacweb07/walnacweb07an/b413/hoc.mwtinccom/wp-includes/functions.php on line 5107
As I checked wp_options table URL is correct and entered without www extension
Rest other pages are working, earlier
MEMORY_LIMIT was 64M
and then I changed it to 256M, but still getting same error.
Can anyone help to fix?
Your WordPress memory settings are in wp-config.php.
Add define('WP_MEMORY_LIMIT', '256M');

Symfony App - Doctrine FATAL ERROR - Memory exhausted without trace

I'am receiving sometimes this error:
Uncaught Exception Symfony\Component\Debug\Exception\OutOfMemoryException: "Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 290816 bytes)" at project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php line 117
OR
"project/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:2822"
But this is all i got, no trace, no nothing. Had anyone got a similar issue? (always 134217728 and tried to allocate 290816 bytes) .
Thank you!
You must change memory_limit parameter in php.ini, because Doctrine has exhausted the available php memory

Getting Error on composer run to install modules "VirtualAlloc"

Getting this error on "composer require drupal/module-name".
I want to install a module on my drupal site but it always returns me this error.
VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.
VirtualFree() failed: [0x000001e7] Attempt to access invalid address.
VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.
VirtualFree() failed: [0x000001e7] Attempt to access invalid address.
Fatal error: Out of memory (allocated 1711276032) (tried to allocate 4096 bytes) in
phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on
line 223
Update on your php.ini file's: memory_limit= XXXM
Replace XXXM value by the memory that you wanna allocate.
Or replace XXXM by -1 to negate memory limit condition.
Virtual memory Error on composer run Solution (Windows)
Download PHP 7.3+ and place on a folder on c drive
Change the environment variable path of PHP to new php
Set the memory limit to -1 in PHP 7.3+ ini file Also uncomment the required extensions.
Run Composer

OutOfMemoryException symfony 3

I am running Symfony3 with Doctrine and Sonata Admin. I don't think I need to get into details about the project. The problem is that while I am editing one of my big entities I get an:
HTTP ERROR 500
When I cut down some properties of the Entity, I get an:
OutOfMemoryException in FileProfilerStorage.php line 158:
Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 5371354 bytes)
Tried:
1. Out of memory error in symfony failed
2. Changing php.ini memory_limit from 128M to 4048M (Step by step, I know it is too much), everything failed
3. php -d memory_limit=1024M app/console cache:clear --env=prod, various values, failed
4. also php bin/console cache:clear failed
Then, what's next?

Sonata error during loading data

I have an error when i'm executing Sonata's command to load the data :
php bin/load_data.php
My console return me the error
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes)
in /Projets/LGAV/app/bootstrap.php.cache on line 2675
An error occurs when running a command!
I don't know how to fix it...
Do you have an idea ?
Thanks
Have you tried to increase memory limit in php.ini?
memory_limit config param is 128MB by default, sometimes it could be too small value.

Resources