I want to get get memory usage info for each called method/function during a request. I'm working on a cloud service, for past years. When PHP 7.0 released, we noticed that we had about 30% more memory usage with same codes.
On 7.1, we noticed that 10% more memory usage was common for each request.
At the time we faced a trade-off between speed and memory (also cool new features), and we chose to upgrade our environment.
But now, PHP 7.2 has almost the same speed as 7.1 while we noticed that again, about 10% more memory is used by our codes on 7.2.
I want to know how to test our codes and see how much memory each method is using during a request. I tried a few things like memory_get_usage() or Meminfo but I'm looking for a way to automatically generate a report for all methods/functions that are called during a request. It's really impossible to check 2000+ methods/function by hand.