#1
  1. Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    13
    Rep Power
    0

    Question How to see the Memory used by a PHP script?


    Hello,

    I'm doing a lot of tests here and I want to know if is possible to see the memory used by a PHP script.
    A program that shows the memory usage of a moment?

    I have tried the PHP funcion 'memory_get_usage()', but PHP is returning the error: Fatal error: Call to undefined function: memory_get_usage()

    I have read the PHP Manual: http://www.php.net/manual/en/functio...-get-usage.php

    And it says: "memory_get_usage() will only be defined if your PHP is compiled with the --enable-memory-limit configuration option."

    And I have read my php.ini and it has the memory_limit enabled and functional..
    So, this function works only on unix?

    The manual has this:
    "memory_get_usage
    (PHP 4 >= 4.3.2)"

    And my PHP is 4.3.4.

    Please, anybody knows what is happening?

    Thanks
    Alfred
  2. #2
  3. No Profile Picture
    loves google.
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2001
    Location
    Pacific Northwest
    Posts
    645
    Rep Power
    32
    Originally Posted by Pardall
    I have read the PHP Manual: http://www.php.net/manual/en/functio...-get-usage.php

    And it says: "memory_get_usage() will only be defined if your PHP is compiled with the --enable-memory-limit configuration option."

    And I have read my php.ini and it has the memory_limit enabled and functional..
    So, this function works only on unix?
    The keyword there is compiled which means when your PHP was compiled/created/made it must be given --enable-memory-limit. Editing php.ini does not affect this. Also, within the user comments on that manual page is a way to do it in *nix without using memory_get_usage().
  4. #3
  5. Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    13
    Rep Power
    0
    Originally Posted by Philip Olson
    The keyword there is compiled which means when your PHP was compiled/created/made it must be given --enable-memory-limit. Editing php.ini does not affect this. Also, within the user comments on that manual page is a way to do it in *nix without using memory_get_usage().
    Yes, I have read the comments.
    But I only use windows.

    Do you know another way to see the memory usage? Like a application? I've downloaded a lot of "benchmarking" apps.. but no one show the memory detailed..

    Thanks for the reply.
  6. #4
  7. No Profile Picture
    loves google.
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2001
    Location
    Pacific Northwest
    Posts
    645
    Rep Power
    32
    No, I don't. Cool people use Linux
  8. #5
  9. Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    13
    Rep Power
    0
    Originally Posted by Philip Olson
    No, I don't. Cool people use Linux
    Hehe
    But.. I never had problems with windows..
    I don't have things to say against the Windows..
    It's always good to me. It has all I need.

    Oh... only this memory_usage.. it hasn't..

Similar Threads

  1. Replies: 5
    Last Post: November 20th, 2001, 05:46 PM
  2. Calling php script from perl cgi script
    By cschilbe in forum Perl Programming
    Replies: 1
    Last Post: May 28th, 2001, 05:52 PM
  3. Replies: 7
    Last Post: April 8th, 2001, 05:52 PM
  4. comparing a PHP, CFM, and ASP script
    By Atticus in forum PHP Development
    Replies: 0
    Last Post: December 29th, 2000, 02:36 PM
  5. using php from a perl script
    By Vik in forum PHP Development
    Replies: 0
    Last Post: November 6th, 1999, 12:58 AM

IMN logo majestic logo threadwatch logo seochat tools logo