PHP Fatal error: Out of memory
Bonjour,
Il y a +- 2mois, j'ai mis en ligne une nouvelle version de mon site qui était sous symfony 2.7.
Cette nouvelle version utilise actuellement la version 4.1 de symfony.
Depuis cette nouvelle version, j'ai par moment une erreur de type " PHP Fatal error: Out of memory" lorsque j'effectue certaines action. Après plusieurs test, j'ai l'impression que l'erreur vient de monolog et de l'insertion de logs au fichier.
J'ai déjà effectué de nombreux changement, test,... A un moment, ca redevient normal, plus d'erreur mais l'erreur revient après quelques heures ou quelques jours.
Je n'arrive pas à trouver le réel origine du problème.
Je suis sur un vps avec php 7.2 et 4Go de ram.
J'ai remarqué que lorsqu'il y a cette erreur, l'utilisation de la ram monte de 10% et je dois faire un "sudo service php7.2-fpm restart" pour que ca redescende.
Voici les message d'erreur:
Citation:
2018/09/14 13:04:04 [error] 22789#22789: *12787 FastCGI sent in stderr: "PHP message: PHP Fatal error: Out of memory (allocated 933232640) (tried to allocate 20480 bytes) in /home/animauxperdus/www/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107
PHP message: PHP Fatal error: Out of memory (allocated 933232640) (tried to allocate 73728 bytes) in /home/animauxperdus/www/vendor/composer/ClassLoader.php on line 444" while reading response header from upstream, client: 217.136.17.89, server: animauxperdus.net, request: "GET /utilisateur/annonce/ajouter/chien/perdu HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "animauxperdus.net", referrer: "https://animauxperdus.net/inscription/"
2018/09/14 13:04:42 [error] 22789#22789: *12787 FastCGI sent in stderr: "PHP message: PHP Fatal error: Out of memory (allocated 803209216) (tried to allocate 20480 bytes) in /home/animauxperdus/www/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107
PHP message: PHP Fatal error: Out of memory (allocated 803209216) (tried to allocate 20480 bytes) in /home/animauxperdus/www/vendor/symfony/debug/ErrorHandler.php on line 596" while reading response header from upstream, client: 217.136.17.89, server: animauxperdus.net, request: "GET /utilisateur/annonce/ajouter/chien/perdu HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "animauxperdus.net", referrer: "https://animauxperdus.net/"
2018/09/14 13:51:05 [error] 22789#22789: *13088 FastCGI sent in stderr: "PHP message: PHP Fatal error: Out of memory (allocated 851443712) (tried to allocate 20480 bytes) in /home/animauxperdus/www/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107
PHP message: PHP Fatal error: Out of memory (allocated 851443712) (tried to allocate 20480 bytes) in /home/animauxperdus/www/vendor/symfony/debug/ErrorHandler.php on line 596" while reading response header from upstream, client: 217.136.17.89, server: animauxperdus.net, request: "GET /utilisateur/annonce/ajouter/chien/perdu HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "animauxperdus.net", referrer: "https://animauxperdus.net/"