Jump to content


Photo

Memory Watch


  • Please log in to reply
3 replies to this topic

#1 <?=$humour?>

<?=$humour?>
  • Members
  • Pip
  • Newbie
  • 6 posts
  • LocationBrisbane, AU

Posted 06 January 2005 - 11:30 AM

Hi,

I was wondering any anyone out there had an experience in getting memory usage for a request. I had a look at apd and it isn't the go (CGI only, for one thing). I was hoping for something that I can start at the begining of the script and at the end run a bunch of methods that can tell me things like how much memory the server used to perform the request and where. I get the feeling that it would need a PHP extension to do this as the Zend engine doesn't expose that kind of thing. :unsure:

Anybody?
What I'd like to see:
- I'd like to see a PHP code checker that has the following line:
55 errors in 13 lines; error thrown [PHP_ERROR_SOD_OFF]; PHP has decided you're too stupid to use it, reformatting hard drive ( \ ).


#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 06 January 2005 - 04:53 PM

:blink: i have no idea how to capture memory specific to the script itself, but you could for the system. if you are on linux, you can capture the command output of 'free' at the start and end of your script.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 <?=$humour?>

<?=$humour?>
  • Members
  • Pip
  • Newbie
  • 6 posts
  • LocationBrisbane, AU

Posted 10 January 2005 - 02:55 AM

REQ Move to Core PHP Hacking pls
What I'd like to see:
- I'd like to see a PHP code checker that has the following line:
55 errors in 13 lines; error thrown [PHP_ERROR_SOD_OFF]; PHP has decided you're too stupid to use it, reformatting hard drive ( \ ).


#4 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 10 January 2005 - 08:32 PM

FYI - You maybe able to do it yourself. Check memory before and after a function, set of code, etc.

Needs PHP to be compiled with the --enable-memory-limit though:
http://us2.php.net/m...y-get-usage.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users