Running Garbage Collector

Hi Dhrup,

Simple question for you, what does Garbage collector do ? And how can i trigger it and see the output in the browser ?

Thanks
Uddhava dasa

  • ohh, I almost missed that direct question...  there's only 1 way find out.. "read the code" ;-)

    mod/garbage_collector/start.php

       function garbagecollector_cron($hook, $entity_type, $returnvalue, $params)
        {
            global $CONFIG;
            echo elgg_echo('garbagecollector');
            // Garbage collect metastrings
            echo elgg_echo('garbagecollector:gc:metastrings');
            if (delete_orphaned_metastrings()!==false) {
                echo elgg_echo('garbagecollector:ok');

    engine/lib/metastrings.php

        /**
         * Delete any orphaned entries in metastrings. This is run by the garbage collector.
         *
         */
    ... which by the way shuld also answer this other post on metastrings... http://community.elgg.org/mod/groups/topicposts.php?topic=154099&group_guid=7

  • Hi Dhrup,

    Ahh very much thankful. Now its clear.

    So , only one thing left, how can i trigger the Garbage collector manually and even better, how to see the output in the browser (i saw someone else put an output text after running it)?

    Regards
    Uddhava dasa

  • I'm not sure on this. I've not really ever run the garbage collector for my own test sites ;-) but here's a tpoic that talks a little abut it -- http://community.elgg.org/mod/groups/topicposts.php?topic=31248&group_guid=23300.. might help

  • @Uddhava

    You can run this manually. Type: www.mysite/pg/cron/weekly/

    Make sure you have crontrigger installed and active in admin>Tools.

    Here is the display I get:

    GARBAGE COLLECTOR Cleaning up unlinked metastrings: OK Optimizing access_collection_membership OK Optimizing access_collections OK Optimizing annotations OK Optimizing api_users OK Optimizing config OK Optimizing datalists OK Optimizing entities OK Optimizing entity_relationships OK Optimizing entity_subtypes OK Optimizing geocode_cache OK Optimizing groups_entity OK Optimizing hmac_cache OK Optimizing metadata OK Optimizing metastrings OK Optimizing objects_entity OK Optimizing private_settings OK Optimizing river OK Optimizing sites_entity OK Optimizing system_log OK Optimizing users_apisessions OK Optimizing users_entity OK Optimizing users_sessions OK DONE

    I hope this helps!

  • ;-) thx i thought i had vaguely seen that somewhere...

  • Hi AlphaNeon,

    Thanks that did it,

    Regards,
    Uddhava dasa

  • ok been following along, I still get the error in my log:

    /web/cgi-bin/php5: Symbol `client_errors' has different size in shared object, consider re-linking WARNING: 2009-07-29 13:07:34 (MST): "Missing argument 1 for ElggDiskFilestore::__construct(), called in /xxxx/x/xxx/x/xxxxx/engine/lib/filestore.php on line 623 and defined" in file /xxxxx/x/////x//x/x//x/engine/lib/filestore.php (line 156) would anyone have any ideas?

  • Works fine for me except that i still have thousands empty lines in elgg_objects_entity (just the ID)

  • If I uninstall a plugin, whatever changes were previously made with it, appear again after reinstalling the same plugin.

    How can you completely uninstall a plugin and cleanup after it (without going to the database and making deletions by hand)?

    Would running the garbage collector manually do it? And if yes, how to run it manually?

  • Thats a good question @rm@nd@ I have a plugin I need to completely get rid of from the database also, the userpoints plugin, but I really do not like tinkering around in DBs and removing things manually. Sure, I can delete the folder from the server, but re-install the settings and all the points will still be there. So I just have it disabled for now until I can figure this out.