0

I'm running some commands on the shell from PHP (such as ImageMagick's "convert" utility, among others), and I'd like to track the peak memory usage of those processes. PHP has a pretty simple way of getting peak memory usage of the PHP script itself, and I'd like to augment that data with information about external scripts run by the PHP script.

Is there some way to do that?

hakre
  • 193,403
  • 52
  • 435
  • 836
Ben Dilts
  • 10,535
  • 16
  • 54
  • 85
  • PHP has no way of monitoring that directly. external apps are their own separate process/memory space, so PHP's memory tracking systems don't apply. You'd need to check if your host OS has some auditing systems you could query for the information. – Marc B Oct 14 '11 at 19:08

1 Answers1

0

If you are running Linux you have 3 options: free, vmstat and top, depending on your specific needs use one or other.

But perhaps if you have very specific requirements the best is create your own C application that has more access to system memory space.

Community
  • 1
  • 1
Ivan
  • 14,692
  • 17
  • 59
  • 96