Warning: "Used memory grew by more than 10 MB when executing job ... UpdateAvailableNotifications"

Version info

Nextcloud version (eg, 20.0.5): 29.0.0
Operating system and version (eg, Ubuntu 20.04): Debian 12
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.59
PHP version (eg, 7.4): 8.2.18

The issue you are facing:

Warning:

Used memory grew by more than 10 MB when executing job OCA\UpdateNotification\BackgroundJob\UpdateAvailableNotifications

It’s a bit of nitpicking for sure but… I don’t like having even a warning for me there is a problem somewhere and it should be fixed.

Is this the first time you’ve seen this error? (Y/N):

Yes

Steps to replicate it:

I would assume:

  1. Configure maintenance hours
  2. Let run the maintenance cronjob

The output of your Nextcloud log in Admin > Logging:

{"reqId":"U6b2Q9bDGWzSS0dsf7Q6","level":2,"time":"2024-05-01T04:20:52+02:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Used memory grew by more than 10 MB when executing job OCA\\UpdateNotification\\BackgroundJob\\UpdateAvailableNotifications (id: 13740, arguments: null): 41.4 MB (before: 30.5 MB)","userAgent":"--","version":"29.0.0.19","data":{"app":"cron"}}
{"reqId":"Wxf4y3OcWsfw3jBOTk8A","level":2,"time":"2024-05-02T04:25:59+02:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Used memory grew by more than 10 MB when executing job OCA\\UpdateNotification\\BackgroundJob\\UpdateAvailableNotifications (id: 13740, arguments: null): 40.3 MB (before: 30.6 MB)","userAgent":"--","version":"29.0.0.19","data":{"app":"cron"}}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

Actual config
<?php
$CONFIG = array (
  'instanceid' => '(╯°□°)╯︵ ┻━┻',
  'passwordsalt' => '(╯°□°)╯︵ ┻━┻',
  'secret' => '(╯°□°)╯︵ ┻━┻',
  'trusted_domains' => 
  array (
    0 => '(╯°□°)╯︵ ┻━┻',
  ),
  'datadirectory' => '/var/www/html/data',
  'version' => '29.0.0.19',
  'installed' => true,
  'maintenance' => false,
  'maintenance_window_start' => 6,
  'upgrade.disable-web' => false,
  'updater.release.channel' => 'stable',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '(╯°□°)╯︵ ┻━┻',
    'port' => (╯°□°)╯︵ ┻━┻,
  ),
  'dbtype' => 'mysql',
  'dbhost' => 'MariaDB',
  'dbname' => '(╯°□°)╯︵ ┻━┻',
  'dbuser' => '(╯°□°)╯︵ ┻━┻',
  'dbpassword' => '(╯°□°)╯︵ ┻━┻',
  'dbtableprefix' => '(╯°□°)╯︵ ┻━┻',
  'mysql.utf8mb4' => true,
  'default_language' => '(╯°□°)╯︵ ┻━┻',
  'default_locale' => '(╯°□°)╯︵ ┻━┻',
  'default_phone_region' => '(╯°□°)╯︵ ┻━┻',
  'default_timezone' => '(╯°□°)╯︵ ┻━┻',
  'loglevel' => 2,
  'logtimezone' => '(╯°□°)╯︵ ┻━┻',
  'log_rotate_size' => 524288000,
  'log_query' => false,
  'profiler' => false,
  'mail_domain' => '(╯°□°)╯︵ ┻━┻',
  'mail_from_address' => '(╯°□°)╯︵ ┻━┻',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '(╯°□°)╯︵ ┻━┻',
  'mail_smtpport' => '465',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '(╯°□°)╯︵ ┻━┻',
  'mail_smtppassword' => '(╯°□°)╯︵ ┻━┻',
  'mail_sendmailmode' => 'smtp',
  'overwritehost' => '(╯°□°)╯︵ ┻━┻',
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => '(╯°□°)╯︵ ┻━┻',
  'trusted_proxies' => 
  array (
    0 => '(╯°□°)╯︵ ┻━┻',
  ),
  'htaccess.RewriteBase' => '/',
  'theme' => '',
  'app_install_overwrite' => 
  array (
    0 => 'tasks',
    1 => 'money',
  ),
);
Privated config

The (╯°□°)╯︵ ┻━┻ config is fun, but hard to read so I’m posting it here replace with private :wink:

<?php
$CONFIG = array (
  'instanceid' => 'private',
  'passwordsalt' => 'private',
  'secret' => 'private',
  'trusted_domains' => 
  array (
    0 => 'private',
  ),
  'datadirectory' => '/var/www/html/data',
  'version' => '29.0.0.19',
  'installed' => true,
  'maintenance' => false,
  'maintenance_window_start' => 6,
  'upgrade.disable-web' => false,
  'updater.release.channel' => 'stable',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'private',
    'port' => private,
  ),
  'dbtype' => 'mysql',
  'dbhost' => 'MariaDB',
  'dbname' => 'private',
  'dbuser' => 'private',
  'dbpassword' => 'private',
  'dbtableprefix' => 'private',
  'mysql.utf8mb4' => true,
  'default_language' => 'private',
  'default_locale' => 'private',
  'default_phone_region' => 'private',
  'default_timezone' => 'private',
  'loglevel' => 2,
  'logtimezone' => 'private',
  'log_rotate_size' => 524288000,
  'log_query' => false,
  'profiler' => false,
  'mail_domain' => 'private',
  'mail_from_address' => 'private',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'private',
  'mail_smtpport' => '465',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'private',
  'mail_smtppassword' => 'private',
  'mail_sendmailmode' => 'smtp',
  'overwritehost' => 'private',
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => 'private',
  'trusted_proxies' => 
  array (
    0 => 'private',
  ),
  'htaccess.RewriteBase' => '/',
  'theme' => '',
  'app_install_overwrite' => 
  array (
    0 => 'tasks',
    1 => 'money',
  ),
);

Hello,

I had the same problem and I solved it in the following way, at least the warning didn’t appear again.

If you want you can try and if that not work for you is easy to revert.

sudo nano /var/www/nextcloud/cron.php
(or the path where your nextcloud instalation is)

Search in the file (crt+w) “memoryafter” and find this string:

if ($memoryAfter - $memoryBefore > 10_000_000)

Replace the 1 to 3 (30mb), like this:

if ($memoryAfter - $memoryBefore > 30_000_000)

Save and exit (crt+x - > Y - > Enter)

And just like that error is solved (at least for me).

Good Luck

4 Likes

I think this worked for me, didn’t have this issue again after I edit the parameters.

1 Like

Update on this: it didn’t work, unfortunately. Cron jobs is acting like crazy, my disk space usage increased about 20GB too. I made a fresh install and didn’t set up cron jobs for now. I’ll wait for it to be fixed to try again.

Please try this one

Output Buffering must be turned off in .htaccess or .user.ini or php.ini, or PHP will return memory-related errors:

  • output_buffering = 0

Reference: Uploading big files > 512MB — Nextcloud latest Administration Manual latest documentation