You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CleanupHelper, executed in the frontend API request, loads all submissions that need to be deleted (https://github.com/mosparo/mosparo/blob/master/src/Helper/CleanupHelper.php#L65). This can be a large number of submissions. The execution of the query will fill the memory until the memory_limit (usually 128 MB) is reached and the process crashes.
Originally posted by brendofreitas October 19, 2023
I found an error when using mosparo on a large scale, I verified that it is a memory problem. I found a solution that is not so suitable:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in /mosparo/vendor/doctrine/dbal/src/Driver/PDO/Statement.php on line 121
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /mosparo/vendor/composer/ClassLoader.php on line 571
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /mosparo/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php:353
Stack trace:
#0 /mosparo/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php(353): PDOStatement->execute()
#1 /mosparo/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php(120): Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler->doWrite('078f5ab84ad06b3...', '_sf2_attributes...') #2 /mosparo/src/Session/DatabaseSessionHandler.php(64): Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler->write('078f5ab84ad06b3...', '_sf2_attributes...') #3 /mosparo/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php(73): Mosparo\Session\DatabaseSessionHandler->write('078f5ab84ad06b3...', '_sf2_attributes...') #4 [internal function]: Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->write('078f5ab84ad06b3...', '_sf2_attributes...') #5 {main}
thrown in /mosparo/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php on line 353
"
How can we resolve this? I believe that when you are searching the bank it is listing all the data to get to a point, which is not necessary. This increases memory usage to a maximum, slowing down and crashing the application and generating this error.
The text was updated successfully, but these errors were encountered:
Issue
The CleanupHelper, executed in the frontend API request, loads all submissions that need to be deleted (https://github.com/mosparo/mosparo/blob/master/src/Helper/CleanupHelper.php#L65). This can be a large number of submissions. The execution of the query will fill the memory until the
memory_limit
(usually 128 MB) is reached and the process crashes.Reported by
Discussed in https://github.com/orgs/mosparo/discussions/147
Originally posted by brendofreitas October 19, 2023
I found an error when using mosparo on a large scale, I verified that it is a memory problem. I found a solution that is not so suitable:
https://stackoverflow.com/questions/561066/fatal-error-allowed-memory-size-of-134217728-bytes-exhausted
However, I verified that a different type of lib can also be used to avoid this problem:
https://serverfault.com/questions/400434/php-mysqlnd-or-php-mysql
The error log was:
"
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in /mosparo/vendor/doctrine/dbal/src/Driver/PDO/Statement.php on line 121
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /mosparo/vendor/composer/ClassLoader.php on line 571
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /mosparo/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php:353
Stack trace:
#0 /mosparo/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php(353): PDOStatement->execute()
#1 /mosparo/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php(120): Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler->doWrite('078f5ab84ad06b3...', '_sf2_attributes...')
#2 /mosparo/src/Session/DatabaseSessionHandler.php(64): Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler->write('078f5ab84ad06b3...', '_sf2_attributes...')
#3 /mosparo/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php(73): Mosparo\Session\DatabaseSessionHandler->write('078f5ab84ad06b3...', '_sf2_attributes...')
#4 [internal function]: Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->write('078f5ab84ad06b3...', '_sf2_attributes...')
#5 {main}
thrown in /mosparo/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php on line 353
"
How can we resolve this? I believe that when you are searching the bank it is listing all the data to get to a point, which is not necessary. This increases memory usage to a maximum, slowing down and crashing the application and generating this error.
The text was updated successfully, but these errors were encountered: