• Resolved Jacky Lam

    (@jackylamhk)


    This issue is meant to be an extension to the original issue.

    Simply Static (version 3.1.6.2) keeps running OOM in different environments, but despite ensuring WP-CRON is enabled, I keep running into the issue of memory exhaustion.

    Bitnami (LAMP) on t3.micro, memory_limit set to 512M:

    [2024-03-30 22:53:36] [class-ss-archive-creation-job.php:375] Error: (1) Allowed memory size of 536870912 bytes exhausted (tried to allocate 294912 bytes) in <b>/opt/bitnami/wordpress/wp-includes/class-wpdb.php</b> on line <b>2431</b>
    [2024-03-30 22:53:36] [class-ss-archive-creation-job.php:315] Status message: [error] Error: (1) Allowed memory size of 536870912 bytes exhausted (tried to allocate 294912 bytes) in <b>/opt/bitnami/wordpress/wp-includes/class-wpdb.php</b> on line <b>2431</b>

    Locally with lando (LEMP), memory_limit set to 512M:

    [2024-04-01 00:59:36] [class-ss-archive-creation-job.php:380] Error: (1) Allowed memory size of 536870912 bytes exhausted (tried to allocate 294912 bytes) in <b>/app/wordpress/wp-includes/class-wpdb.php</b> on line <b>2349</b>
    [2024-04-01 00:59:36] [class-ss-archive-creation-job.php:320] Status message: [error] Error: (1) Allowed memory size of 536870912 bytes exhausted (tried to allocate 294912 bytes) in <b>/app/wordpress/wp-includes/class-wpdb.php</b> on line <b>2349</b>

    Locally with lando (LEMP), memory_limit set to 1024M:

    [2024-04-01 01:43:48] [class-ss-archive-creation-job.php:380] Error: (1) Allowed memory size of 1073741824 bytes exhausted (tried to allocate 69632 bytes) in <b>/app/wordpress/wp-includes/class-wpdb.php</b> on line <b>2320</b>
    [2024-04-01 01:43:48] [class-ss-archive-creation-job.php:320] Status message: [error] Error: (1) Allowed memory size of 1073741824 bytes exhausted (tried to allocate 69632 bytes) in <b>/app/wordpress/wp-includes/class-wpdb.php</b> on line <b>2320</b>

    It finally worked when I gave WordPress 2GBs of memory (via ini_set( 'memory_limit', '1024M' );). We do have a pretty big site with 3000+ pages, but I was hoping Simply Static would be able to chunk it up. After increasing the memory size, Simply Static was able to export the site in 17.5 minutes.

    There’s also an issue where Simply Static would freeze up if the deployment method is set to ZIP Archive:

    [2024-04-01 01:14:57] [class-ss-archive-creation-job.php:98] Pushing first task to queue: setup
    [2024-04-01 01:15:34] [class-ss-url-fetcher.php:251] Fetching URL: [SITE_URL]

    However, the issue goes away if you set it to Local Directory – it still provides a ZIP download at the end of the generation.

    Creating this topic so anyone in the future facing the same problem can reference it, as the original issue only mentions an issue with WP-CRON. Workaround: Throw more memory at the problem, but if you try this on production, I highly recommend revert after the export is completed.

    • This topic was modified 7 months, 3 weeks ago by Jacky Lam.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author patrickposner

    (@patrickposner)

    Hey @jackylamhk,

    thanks for your insights on this!

    There are two things in Simply Static that can’t be chunked (and thus end up requiring more memory):

    Fetching Pages

    The initial fetch for pages is chunked, but the fetch process for all the integrations is not.

    A good example is Elementor, which pollutes the DB with its countless bunde.js files, easily resulting in a pretty big amount of memory needed.

    ZIP

    We can’t chunk the ZIP process – so this will most likely fail on bigger projects.

    We would need to use another ZIP library within PHP (we currently use PCLZip, which ships with every WordPress installation) to handle that.

    ZipArchive would solve that.

    However, a critical mass of WP hosting setups do not support this package, which makes it pretty much unusable for us.

    WP-CLI:

    However, there is a way around all of that by using our WP-CLI integration (warning: this is a pro-only feature).

    With that, you can run the same export in half the time, with half the memory needed as the WP backend isn’t involved at all.

Viewing 1 replies (of 1 total)
  • The topic ‘Issue with running out of memory’ is closed to new replies.