PHP memory exhausted

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tess15sep
    Junior Member
    • May 2024
    • 3

    PHP memory exhausted


    Dear all,
    I encountered the following problem. I am running multiple flowcharts at night and encounter the following error in the logs every morning:

    "PHP Fatal error: Allowed memory size of 268435456 bytes exhausted..."

    I have already increased the PHP memory limit to 512M at "usr/local/etc/php/conf.d/espocrm.ini". When I run 'php -r "echo ini_get('memory_limit').PHP_EOL;"' this indeed shows me 512M. Finally, when I look under adminstration -> system requirements I also see memory limit is 512M.

    However, converting the number of 268435456 bytes mentioned in the error message to MB I get 256MB (Espo default I believe). Maybe I misunderstood something but can someone clarify this for me? Now I am not sure whether increasing the PHP memory limit actually worked.

    The current EspoCRM version I am working in is 7.4.3.

    Thanks in advance!



    Last edited by tess15sep; 07-08-2024, 02:28 PM.
  • Kharg
    Senior Member
    • Jun 2021
    • 421

    #2
    Can you restart apache?

    also make sure the value is changed for other configurations as well, such as cli.

    Comment

    • wesseldejong
      Junior Member
      • Jan 2025
      • 1

      #3
      Thanks Kharg for thinking along.

      It has been some time but the problem persists and never really got solved.

      Running "php -i | grep memory_limit" we get output "memory_limit => 512M => 512M". Like Tess mentioned we defined this memory limit in espocrm.ini. This file is parsed as indicated when running "php --ini":

      Configuration File (php.ini) Path: /usr/local/etc/php
      Loaded Configuration File: /usr/local/etc/php/php.ini
      Scan for additional .ini files in: /usr/local/etc/php/conf.d
      Additional .ini files parsed: /usr/local/etc/php/conf.d/docker-fpm.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-exif.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-gd.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-imap.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-ldap.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-pcntl.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-zip.ini,
      /usr/local/etc/php/conf.d/docker-php-ext-zmq.ini,
      /usr/local/etc/php/conf.d/espocrm.ini


      In this output "Loaded Configuration File:" first was set to "(None)" which we suspected might be a problem. We created a php.ini file in /usr/local/etc/php which also sets the memory limit at 512M. So both /usr/local/etc/php/php.ini and /usr/local/etc/php/conf.d/espocrm.ini set the memory limit at 512MB

      Still we get the same error (268435456 bytes = 256 MB);

      ERROR: Uncaught Exception Spatie\Async\Output\ParallelError: "PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/application/Espo/ORM/BaseEntity.php on line 1108 " at /var/www/html/vendor/spatie/async/src/Output/ParallelError.php line 11 {"exception":"[object] (Spatie\\Async\\Output\\ParallelError(code: 0): PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/application/Espo/ORM/BaseEntity.php on line 1108\n at /var/www/html/vendor/spatie/async/src/Output/ParallelError.php:11)"}

      Any suggestions what we could do?​
      Last edited by wesseldejong; 01-15-2025, 02:16 PM.

      Comment

      Working...