cantregister2 (@cantregister2)

Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)

  • cantregister2
    Member

    @cantregister2

    bushtool,

    The same thing happened to me. You need to rename the tables back to wp_users and wp_usermeta. You can do this with the command line mysql client…or with phpmyadmin. Depending on your version, you should be able to click on the table name. This gives you a new page with that table’s info. Then under “operations” in the top right, you should find a menu to change the name of the table back to the original name.


    cantregister2
    Member

    @cantregister2

    sorry about the garbled code above. I tried to edit it so that it shows up clean, but bbpress won’t let me.


    Investigating further, this seems to be a known memory leak in PHP:

    http://paul-m-jones.com/archives/262


    cantregister2
    Member

    @cantregister2

    I see the culprit is in the importer:

    <br />
    $topics_query = new BB_Query( 'topic', array(<br />
    'forum_id' => $forum->forum_id,<br />
    'per_page' => -1,<br />
    'topic_status' => 'all',<br />
    'order_by' => 'topic_start_time',<br />
    'order' => 'ASC'<br />
    ) );<br />

    Instead, it should be something like:

    <br />
    $page=0;<br />
    $per_page=50;<br />
    $topics_query = new BB_Query( 'topic', array(<br />
    'forum_id' => $forum->forum_id,<br />
    'per_page' => $per_page,<br />
    'page' => $page,<br />
    'topic_status' => 'all',<br />
    'order_by' => 'topic_start_time',<br />
    'order' => 'ASC'<br />
    ) );<br />

    Strange thing is that even when you step through the pages it still doesn’t free the memory. You can test it with:

    while (isset($topics_query->results)) {

    echo "<p>Mem usage=" . memory_get_usage(true)/1024/1024 . "</p>";

    //echo "

    "; print_r($topics_query->query); echo "

    ";

    //echo "<p>" . $topics_query->results[0] . "</p>";

    $page++;

    $topics_query->query = $page;

    //thought following might help, but doesn't

    //unset($topics_query->results);

    $topics_query->query();

    }

    exit;


    cantregister2
    Member

    @cantregister2

    Here’s an update. I was able to get further by adding the following to ‘step3’ of the bbpress.php file.

    ini_set("memory_limit", "500M");

    but, it seems the import script lags behind incredibly.

    Is there no way to run this on the command line?

    Is there any reason why it is so inefficient with memory usage?


    cantregister2
    Member

    @cantregister2

    Hi thanks again for the response.

    I have increased the memory limits in both the php.in and the wp-config.php file.

    I have also disabled all plugins.

    I can see that when the wp-admin loads up, memory usage is at 30M.

    When the import script gets to the bb_cache_first_posts() function, before it even starts to import the data, total mem usage is 215.75M.

    I suspect there is a memory leak.


    cantregister2
    Member

    @cantregister2

    thanks.

    I did that too. No matter what I set the WP_MEMORY_LIMIT or WP_MAX_MEMORY_LIMIT to, I get the same error that says it stops at 256M.

    Is there anywhere else that the memory limit could be overridden?


    cantregister2
    Member

    @cantregister2

    Like I said before, I changed the script so that it imports the topics incrementally, and not all at once like it was doing previously.

    I am now using memory_get_usage(true) to see what’s going on with php’s memory.

    When I load the wp-admin interface, total mem usage is only around 30M.

    At the top of bb_cache_first_posts() function, total mem usage is 215.75M.

    Why is that? That seems strange to me. Where is all that memory going to?

    I also discovered that my memory usage stays the same for the first 4280 topics in the import process. Then, memory usage goes up until it maxes out on the 15920th topic at 256M.


    cantregister2
    Member

    @cantregister2

    hey thanks for the tip! that was just what I needed.

    I now see the error message that confirms the memory limit ordeal.

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 128 bytes) in /wp-includes/load.php on line 569

    However, if I boost that limit in my php.ini file to 500M and confirm that the memory limit is indeed 500M in php_info(), I still get the same error on import.

    Any ideas on what memory limit I need to set? The machine itself has 1024M of ram

    “free -m” tells me:

    total used free shared buffers cached

    Mem: 1024 705 318 0 6 424

    -/+ buffers/cache: 274 749

    Swap: 2047 38 2009

    I should also mention that I re-wrote the import script so that bb_cache_first_posts doesn’t take all topics at once in on single array, but instead breaks them up for processing into chuncks of 20 using array_chunck

    Where is all of this memory being created and hogged?

    thanks for any more suggestions.


    cantregister2
    Member

    @cantregister2

    This doesn’t seem to work for me. How do I know if I need to migrate users first?

    If I try to migrate users, it says:

    “We’re in the process of migrating your users…

    Renamed the wp_users and wp_usermeta tables to bb_wp_users_tmp and bb_wp_usermeta_tmp respectively.

    There was a problem duplicating the table bb_users to wp_users. Please check and re-run the script or duplicate the table yourself. “

    Which makes sense because there isnt a bb_users table.

    So, I guess I didn’t need that.

    Then I do the next step to “Import forums” and I get:

    “Total number of forums: 11

    Processing forum #1 (FirstForum)

    Added the forum as forum #13021″

    but, then it hangs there.

    any ideas?

Viewing 9 replies - 1 through 9 (of 9 total)