• Resolved therealgilles

    (@chamois_blanc)


    Sorry for the bother. I’m seeing the following out of memory error on one of my sites. The backups seem to be working but just wondering why this is happening.

    Date: 2022-02-19 16:08:35
    An error (1) occurred on line 595 and in the file: .../wp-content/plugins/updraftplus/includes/S3compat.php.
    
    Allowed memory size of 536870912 bytes exhausted (tried to allocate 5242912 bytes)
Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter therealgilles

    (@chamois_blanc)

    I increased the server PHP memory_limit to 512MB (from 128MB). Let’s see if that fixes the issue.

    Plugin Contributor bcrodua

    (@bcrodua)

    Hi,

    Yes, that is a memory limit issue. Please see FAQ for more info – https://updraftplus.com/faqs/deal-fatal-error-allowed-memory-size-errors/

    Thanks,
    Bryle

    Thread Starter therealgilles

    (@chamois_blanc)

    Thanks for the reply.

    My WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT settings for WordPress were already at 512MB. I increased the memory_limit in php.ini. We’ll see what happens. It’s possible another plugin I use has a memory leak, as I see memory error messages on triggering on other PHP code lines.

    Thread Starter therealgilles

    (@chamois_blanc)

    I am seeing the memory issue happening on 3 different sites, and the error messages usually pointing to the S3compat.php file, so I would be surprised if the plugin was not the root of the issue. I saw a recent 1.22.6 update. Hoping it resolves this issue.

    Thread Starter therealgilles

    (@chamois_blanc)

    This is still not resolved and I’m pretty sure it is related to UpdraftPlus Backup. The out of memory messages almost systematically point to files in the plugin, like this one:

    E_ERROR: Allowed memory size of 536870912 bytes exhausted (tried to allocate 1196032 bytes) (Most recent call first)
    
    wp-content/plugins/updraftplus/vendor/guzzlehttp/psr7/src/Utils.php line 308

    Here is the corresponding code in this case:

    302     */
    303    public static function streamFor($resource = '', array $options = [])
    304    {
    305        if (is_scalar($resource)) {
    306            $stream = self::tryFopen('php://temp', 'r+');
    307            if ($resource !== '') {
    308                fwrite($stream, $resource);
    308                fseek($stream, 0);
    309            }
    310            return new Stream($stream, $options);
    311        }
    312
    313        switch (gettype($resource)) {

    Meaning most likely you have a memory leak because something is not getting closed.

    • This reply was modified 2 years, 8 months ago by therealgilles.
    Thread Starter therealgilles

    (@chamois_blanc)

    It is most likely related to these PHP core issues:
    https://bugs.php.net/bug.php?id=79143
    https://bugs.php.net/bug.php?id=78902

    which are the root-cause of this guzzlehttp issue:
    https://github.com/guzzle/guzzle/issues/2555

    The bug was fixed in PHP code but hosts could still be using faulty versions of PHP (7.2 to 7.4.1). A workaround is set to ‘http’ => ‘protocol_version’ to ‘1.0’ instead of ‘1.1’, or setting ‘auto_decode’ to false. There is more info in the above links.

    Thread Starter therealgilles

    (@chamois_blanc)

    Hmm I’m running PHP 7.4.28 on all the servers seeing the issue, so it seems unlikely this is it, as I would expect this version to have been patched. Must be some other memory leak.

    @chamois_blanc

    I think i am getting a very similar error in my debug.log
    PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 5242912 bytes) in /home/www/livesite/wp-content/plugins/updraftplus/includes/S3compat.php on line 594

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PHP out of memory error’ is closed to new replies.