SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    John 8:24 JREAM's Avatar
    Join Date
    Sep 2007
    Location
    Florida
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do you track PHP Memory Usage?

    If you want to test how fast something is being processed, like a form to optimize it, how do people go about doing this?


    I tried
    get_memory_usage();
    but that gave me an error, I need some execcgi or something to load locally?

  2. #2
    SitePoint Evangelist priti's Avatar
    Join Date
    Aug 2006
    Location
    India
    Posts
    488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can benchmarking helps you?

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2006
    Location
    Wigan, Lancashire. UK
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JREAM View Post
    If you want to test how fast something is being processed, like a form to optimize it, how do people go about doing this?
    A good IDE with profiling capabilities

    Quote Originally Posted by JREAM View Post
    I tried
    get_memory_usage();
    but that gave me an error, I need some execcgi or something to load locally?
    Won't help you with the speed of execution, but I use:
    PHP Code:
    echo "Peak memory usage: " . (memory_get_peak_usage(true) / 1024 1024) . " MB\r\n"
    to get a feel for the memory usage
    ---
    Development Projects:
    PHPExcel
    PHPPowerPoint

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    xdebug has a profiling option. make sure to view the output files with something like wincachegrind.

    Usually you don't look at memory usage too much when concerned about execution speed. The two are definately related, but using more memory doesn't really correspond to faster/slower.

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by priti View Post
    can benchmarking helps you?
    Benchmarking can show you the actual performance. So think it helps in tracking PHP memory usage.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •