WordPress.org

Ready to get started?Download WordPress

Forums

Memory profiling (3 posts)

  1. gfindlay
    Member
    Posted 6 years ago #

    I'm surprised that no-one has written one yet, unless I just can't find it.

    I'm looking for a memory profiling plugin for WP that will give peak memory use for the site, individual plugins, etc. to see where the hogs are. I do run a lot of plugins, but I've had to push my memory_limit up to 64M which seems a bit excessive.

    Any thoughts, ideas, suggestions gratefully received.

  2. gfindlay
    Member
    Posted 6 years ago #

    No-one?

    So no-one is interested in finding out how much memory their site is using/wasting? That's a surprise.

  3. jbauguss
    Member
    Posted 6 years ago #

    Here. create a plugin with this content.

    <?php
    /*
    Plugin Name: Mem Usage
    */

    function mem_init() {
    $GLOBALS["memused"] = "
    memory usage after wordpress init: " . memory_get_usage() . " Bytes
    ";
    }

    function mem_foot() {
    echo $GLOBALS["memused"];
    echo "
    memory usage after wordpress is done: " . memory_get_usage() . " Bytes
    ";
    print_r($GLOBALS);
    }

    add_action("init", "mem_init");
    add_action("wp_footer", "mem_foot");
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic