1

Do you know if there's a way to log how much memory is used in PHP scripts?.

I would like a log that tells me which objects are using more memory, which functions I need to improve, etc.

It would be something like memory_get_usage but for each line of code.

Raul Leaño Martinet
  • 2,015
  • 6
  • 27
  • 41

1 Answers1

1

Xdebug's execution trace might be closest to what you're looking for. It traces every include, function call and method call to a human-readable file that can optionally (with xdebug.show_mem_delta setting on) show the difference in memory usage between calls.

lafor
  • 12,079
  • 3
  • 31
  • 34