Tagged: bug, enfold, php compatibility
-
AuthorPosts
-
January 20, 2025 at 2:27 pm #1475423
Hi we are experiencing an issue with Enfold on one of our sites where the memory limit is getting exausted when trying to view any ALB image element on our site.
It times out and when I check the log files I get the following:
If we have redis enabled:
AH01071: Got error ‘; PHP message: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 1310720 bytes) in /var/www/vhosts/domainname.com/httpdocs/wp-content/object-cache.php on line 2534’, referer: https://domainname.com/wp-admin/post.php?post=14&action=editIf we have redis disabled:
AH01071: Got error ‘PHP message: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 5242880 bytes) in /var/www/vhosts/domainname.com/httpdocs/wp-includes/class-wp-object-cache.php on line 239’, referer: https://domainname.com/wp-admin/post.php?post=14&action=editThis is accompanied by a console error:
Failed to load resource: server responded with a status of 500 ()
wp-admin/admin-ajax.php
wp-admin/load-scripts.php
I am assuming these two errors are because the process has stopped – And the cause is something to do with the issues above.We therefore cannot change the images on this site.
I have raised this issue before but we couldnt find a cause.
The allowed memory size is much larger than the limit suggested here. So not sure where the memory limit at 536870912 bytes is being pulled from.
I think this is an issue with PHP compatibility and the avia builder. The problem seems to be worse in anything above php 8.0. We are now running PHP 8.2 on this site and the problem occurs with consistency.
Please can you let me know what you need from us to investigate? I can provide login credentials if required.
- This topic was modified 5 days, 16 hours ago by thinkjarvis.
- This topic was modified 5 days, 16 hours ago by thinkjarvis. Reason: redacted url for security
January 20, 2025 at 2:32 pm #1475425If you want me to raise this on github with screenshots please let me know.
January 20, 2025 at 2:42 pm #1475426Following on from this – This could be caused by an assumption being made in the code somewhere.
We have changed the PHP version back to version 8.2 latest.
But this time added wp-config define memory limit and max memory limit lines stating 2gb max memory limit.
The actual limit in the php settings is 4gb. but 2gb is the post max size so dont want the usage to exceed this ideally. These figures are the same for all of the php versions on our server. The only change is we defined it in WP-Config for the site.
Upon first attempt this has worked. But quite often this has been the case so need to keep an eye on the issue.
I guess we need to determine if anything in Enfold specifically related to the ALB image element looks for the memory limit?
Can you let me know how we proceed with this?
- This reply was modified 5 days, 16 hours ago by thinkjarvis.
January 20, 2025 at 6:50 pm #1475440Hi,
Everything on a WordPress installation consumes memory basically. I don’t think that this is a problem specific to Enfold, but it happens while you are using Enfold since it’s your active theme. I would suggest that you try using a plugin like this, to check what is consuming the most resources on your site: https://wordpress.org/plugins/query-monitor/
Best regards,
RikardJanuary 23, 2025 at 4:36 pm #1475668Hi Rikard,
We used query monitor – It doesnt tell us anything useful.
It appears there is a memory leak somewhere or something in Enfold is picking up the wrong memory limit when it isnt specified.For our site we just had to tell wordpress what the memory limits are by adding the following to wp-config.php
For us the 2gb limit per action looks like this:define('WP_MEMORY_LIMIT', '2048M'); define('WP_MAX_MEMORY_LIMIT', '2048M');
For some reason the error code in the console was suggesting that the memory limit was around 512mb (written in bytes).
For context we actually have a 4gb memory limit – So there shouldnt have been a problem anyway but specifying a figure in wp-config seems to have solved the issue. I’ll report back if I can recreate it again.
The problem does not occur in PHP 8.0 but does occur in all versions above this.
With this in place the problem seems to have stopped and we are running PHP 8.2 again now. So it looks like there is an issue with the memory allocated to some actions in Enfolds interface not able to use the available ram fully.Someone else reported a simillar issue here:
I was writing a reply on the post above explaining this when you closed it too early!!!!
Can you reopen it and add my suggestion above!January 23, 2025 at 7:43 pm #1475679Hi,
Thanks for the update. What does the value WP_MEMORY_LIMIT say under Tools->Site Health->Info say on your installation? Defining your own memory limit sometimes doesn’t work, since it’s set by the provider.
Best regards,
RikardJanuary 23, 2025 at 8:09 pm #1475683Hi both site health and woocommerce system info show the 4gb max limit. I set 2gb because 4gb is too large and overkill.
We run our own dedicated servers so it’s no issue with the provider. We set our own settings.
I can confirm that there is nothing wrong with the PHP, MySQL, mariadb or Plesk config.
The issue is for some reason some actions in the enfold builder are unable to allocate the required memory.
My suggested solution forces WordPress to recognise the correct memory limit.
As above the problem does not occur in php8 but started in php8.1 and above. I also checked the individual php fpm memory settings for each version.
Adding the memory limit to the wp-config forces WordPress to accept the new value and appears to stop the process hitting a false memory limit.
If this has fixed the problem then you guys need to investigate a possible memory leak or bug in the Avia builder in php8.1 and above.
January 24, 2025 at 5:51 pm #1475743 -
AuthorPosts
- You must be logged in to reply to this topic.