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?
Related
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
I used composer to install pimcore. Right now I am attempting to add routing for a new theme I'm using, but I reach a routing error. Based on symfony's documentation I realized I need to run composer require annotations but I get hit with this error:
[InvalidArgumentException]
Could not find package annotations.
Did you mean one of these?
minime/annotations
zeptech/annotations
ray/di
jms/metadata
jms/aop-bundle
after some looking around, I see that I first need to run composer require sensio/framework-extra-bundle. However, when I run it, after some time, I get hit with
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
PHP Fatal error: Out of memory (allocated 2929729536) (tried to allocate 4096 bytes) in
phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 129
Fatal error: Out of memory (allocated 2929729536) (tried to allocate 4096 bytes) in
phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 129
I'm realizing this is a memory issue, there are currently 3GB of memory on the server (running via DigitalOcean). What are my options? Running Ubuntu 16.04 btw.
I should add that my memory limit in php.ini is set to -1.
That is because PHP is running with a memory limit by default. You can by-pass it by running the following command.
php -d memory_limit=-1 /usr/local/bin/composer install
Another option would be updating your php.ini files and setting the memory_limit = -1.
Update: I solved it by running
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=4096
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
to add 4 GB of memory from the hard drive.
Then I just run my command and it updated the framework with no problem. Hope this helps someone
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
I was using everyday assetic in work (OS: Win7) but today i was runned command: php bin/console assetic:watch and get this error:
[Symfony\Component\Debug\Exception\ContextErrorException] Notice: unserialize(): Error at offset 0 of 25228 bytes
I was try clear cache - don't help.
I not delete any file and in repository that file not exist and this project is on 3 machines (don't have access now only to 1) and everywhere it works...
Nothing was updated or installed to project so far as i know.
So helped delete all files with prefix assetic_watch_* in %LOCALAPPDATA%\Temp\
bin/console assetic:watch --force also cleared for me.
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.