Fatal error memory allocation exhausted

I am trying to create a snapshot using MPMU DEv plugin, but I keep getting this error
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 523800 bytes) in /home/micoachd/public_html/wp-includes/wp-db.php on line 1518

I try using both zip settings, one that uses file and the other that use memory to create the zip,
but both crashes..
ZipArchive - Im most cases ZipArchive is built into PHP and primarily uses files instead of memory to compress large file.
PclZip - is part of the WordPress core libraries. PclZip will use memory for temp storage when compressing large files.

What can I do?


  • Paul
    • The Green Incsub


    For now forget the php code provided by PC.

    In your wp-admin go to Snapshots > Settings. Look for the panel 'System Info' which should show the PHP, MySQL, etc information.

    Just below the 'System Info' you should see the section for Memory. Note this memory is specific to when running a backup/restore. So please set this somewhat high at least 256M.

    Also, check your wp-config.php for how much memory you have allocated for WordPress as a whole. http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

    Next, check the segment size also on the Settings page. The segment size defines how many database rows to be processed at a time. This is to enable handling of very large database tables that might have many thousand rows.

    Let us know.

  • manolo_mendoza
    • Flash Drive

    mmh.. this is the system info.
    The following table shows version information about your server. When contacting support it might be helpful to provide this information along with your specific issues.
    WordPress Version 3.5.1
    PHP Version 5.3.26
    MySQL Version 5.1.69
    Is Multisite Yes, Number of Sites: 3
    WP_CRON Snapshot uses WP_CRON to run automated backups. If you have disabled WP_CRON via your wp-config.php you will not be able to schedule snapshots.
    WP_CRON Enabled.
    _SESSION Snapshot uses _SESSIONS to store temporary information about database tables and files during the backup and restore processing. Sessions are a default part of PHP.
    Session save path: /tmp
    Session save path is a valid directory.
    Session save path is writeable.
    Folder Permissions Writable (0777) – /wp-content/uploads/snapshots
    Writable (0777) – /wp-content/uploads/snapshots/_backup
    Writable (0777) – /wp-content/uploads/snapshots/_locks
    Writable (0777) – /wp-content/uploads/snapshots/_logs
    Writable (0777) – /wp-content/uploads/snapshots/_restore
    PHP runtime information
    Display Errors 1
    Error Reporting 4983 - E_ERROR, E_WARNING
    Magic Quotes 1
    Max Execution Time (seconds) 300 The value displayed can be adjusted by Snapshot PHP scripts.
    Memory Limit 64M - WP_MEMORY_LIMIT defined by WordPress wp-config.php.
    Open Basedir Off
    Safe Mode Off
    ZLib Compression Off

    In the memory value from snaptshot settings I put 360M
    I ran the snaptshot and got
    Fatal error: Allowed memory size of 377487360 bytes exhausted (tried to allocate 262210 bytes) in /home/micoachd/public_html/wp-includes/functions.php on line 3788

    I just have 3 blogs and 2 of them are empty.. the third has just few posts....

    The segment value I am using is 1000

    any other way to resolve it?


  • Paul
    • The Green Incsub


    Apologies for not replying earlier as I didn't see your response.

    So you set the snapshot memory to 360Mb and now the error is hitting that limit when the archive gets above 377Mb.

    Are you running or have you run other backup tools that might have left large archive files within your wp-content folder tree? Are you running a cache plugin? You might want to look into your files and see if large files can be excluded.

    Have you tried switching the Zip compress type? You can do this on Snapshot > Settings then look for the 'Compression Library' section. Try the PclZip which is native to PHP. The default ZipArchive is a library that comes with WordPress by uses heave amounts of memory.

    I've personally create snapshot archives well over 1G in size. But this was on a dedicated hosting server.

    Try this. Split the archives. Try creating one Snapshot configuration for just the database tables. Then another for just the plugins and themes files. Then a third for just the media (wp-content/uploads/)

    Keep me posted.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.