Forum Replies Created

Viewing 1 replies (of 1 total)
  • This is bit late but here is what worked for me…

    During the insert process there are a few WordPress variables that get quite bloated, so once you have inserted say, a 1000 posts, you can reset them:

    global $wpdb, $wp_actions;
    $wpdb->queries = array();
    $wp_actions = array();
    wp_cache_flush();

    These were the main culprits in my case…and releasing them freed a good chunk of memory

    In my case for a bulk insert of 6000~ posts it was originally taking upto 300 MB, but after releasing the memory after every 1000 inserted posts memory usage never went above 50 MB.

    ps. You can use var_dump(get_defined_vars()); to have a look at whats taking up memory in your case and free variables appropriately.

Viewing 1 replies (of 1 total)