Answer the question
In order to leave comments, you need to log in
How to get around mmap() failed: [12] Cannot allocate memory?
When trying to write a large amount of data to the DBMS, the error mmap() failed: [12] Cannot allocate memory?
The script is executed through php (nginx). DBMS - mysql.
Launched via terminal.
To execute the script, I use the Symfony2.8 framework
. Error:
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
PHP Fatal error: Out of memory (allocated 3083886592) (tried to allocate 25165832 bytes) in /server/www/erohost.dev/www/vendor/symfony/symfony/src/Symfony/Component/Stopwatch/StopwatchEvent.php on line 102
[2016-02-13 12:37:13] php.CRITICAL: Fatal Error: Out of memory (allocated 3083886592) (tried to allocate 25165832 bytes) {"type":1,"file":"/server/www/erohost.dev/www/vendor/symfony/symfony/src/Symfony/Component/Stopwatch/StopwatchEvent.php","line":102,"level":-1,"stack":[]}
[Symfony\Component\Debug\Exception\OutOfMemoryException]
Error: Out of memory (allocated 3083886592) (tried to allocate 25165832 bytes)
Answer the question
In order to leave comments, you need to log in
You can write "page by page", say, in portions of 1000 records, wrapping the request in a transaction.
The number of records in a "page" can be determined empirically, based on the amount of available memory.
PHP Fatal error: Out of memory
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question