Core: 芦mmap() failed: [12] Cannot allocate memory禄 message in cron.php output

Created on 15 Dec 2018  路  13Comments  路  Source: owncloud/core

Two weeks ago I've received message like this in cron.php's output:

mmap() failed: [12] Cannot allocate memory

Sometimes it gives me more specific info:

mmap() failed: [12] Cannot allocate memory
PHP Fatal error:  Out of memory (allocated 398991360) (tried to allocate 20480 bytes) in /var/www/owncloud/apps/files_trashbin/lib/Helper.php on line 92

The files, lines and sizes in message may vary.

This installation of ownCloud was set up month or few ago. Previous was OC 9.x on Ubuntu 14 preconfigured by DigitalOcean and I seen no errors like this. Now I get these errors few times a day.

My current server have 1Gb of RAM and 25Gb of disk space.

It may be coincidence but earlier I've run into bug with thumbnails for deleted files and file versions.

Server configuration

Operating system:
18.04.1 LTS (GNU/Linux 4.15.0-42-generic x86_64)

Web server:
Apache/2.4.29 (Ubuntu)

Database:
MariaDB 10.1.34

PHP version:
PHP 7.2.1

ownCloud version: (see ownCloud admin page)
10.0.10.4 (Community)

Updated from an older ownCloud or fresh install:
Fresh install on fresh machine

Where did you install ownCloud from:
Tarball

Signing status (ownCloud 9.0 and above):
芦No errors have been found.禄

The content of config/config.php:

{
    "system": {
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "localhost",
            "port": 6379
        },
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "minimum.supported.desktop.version": "2.0.0",
        "instanceid": "ochfy4320ivs",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***\/owncloud",
        "dbtype": "mysql",
        "version": "10.0.10.4",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Etc\/GMT-3",
        "log_type": "owncloud",
        "logfile": "\/var\/log\/owncloud.log",
        "loglevel": 2,
        "installed": true,
        "maintenance": false,
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown"
        ],
        "log_rotate_size": false
    }
}

List of activated apps:

Enabled:
  - activity: 2.4.1
  - configreport: 0.1.1
  - dav: 0.4.0
  - federatedfilesharing: 0.3.1
  - files: 1.5.1
  - files_external: 0.7.1
  - files_opds: 0.8.8
  - files_pdfviewer: 0.10.0
  - files_sharing: 0.11.0
  - files_texteditor: 2.3.0
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - gallery: 16.1.1
  - market: 0.2.5
  - notifications: 0.3.5
  - updatenotification: 0.2.1
Disabled:
  - announcementcenter
  - comments
  - encryption
  - external
  - federation
  - files_videoplayer
  - firstrunwizard
  - provisioning_api
  - systemtags
  - user_external

Are you using external storage, if yes which one:
No

Are you using encryption:
No

Are you using an external user-backend, if yes which one:
No

Most helpful comment

In my case, updated memory_limit as memory_limit = 2048M in php.ini works for me.

All 13 comments

GitMate.io thinks the contributor most likely able to help you is @ownclouders.

Possibly related issues are https://github.com/owncloud/core/issues/24156 (cron.php fails with error ), https://github.com/owncloud/core/issues/5198 ([5.0.12 cron.php] Create comprehensible error messages), https://github.com/owncloud/core/issues/14296 (OC8 cron.php failing - createFile() on a non-object - Lucene LockManager), https://github.com/owncloud/core/issues/2116 (Cron Service Fails), and https://github.com/owncloud/core/issues/15996 (php occ l10n:createjs fails with error message).

@ho4ho OC9 works fine on 512Mb. And I don't think it's a bug, just thought I misconfigured something and somebody ran into same issue.

http://techpp.com/2009/07/10/how-to-fix-php-fatal-error-out-of-memory/

There is no memory limit on my installation.

allocated 398991360
= 380 MB

so there limit of memory

I mean my php.ini have line like this:

memory_limit = -1

Today I tweaked apache2.conf with this section:

<IfModule mpm_prefork_module>
        StartServers            3
        MinSpareServers         3
        MaxSpareServers         5
        MaxClients              15
        MaxRequestsPerChild     0
</IfModule>

Not it spawns five processes instead of ten. And I received only one error message since then.

@Linda-chan I think bugtracker not good for questions, better use https://central.owncloud.org/

Please close as unlikely bug in ownCloud.

// Actually it was not a question.

And I don't think it's a bug, just thought I misconfigured something and somebody ran into same issue.

If its not bug then its question?

Issue.

AFAIK:

Bugreports of ownCloud = github
Issues, Problems, Questions, Support of ownCloud = central.owncloud.org

Alright. Thanks.

In my case, updated memory_limit as memory_limit = 2048M in php.ini works for me.

Was this page helpful?
0 / 5 - 0 ratings