PHP内存分析 [英] PHP memory profiling

查看:94
本文介绍了PHP内存分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

分析PHP页面的内存使用情况的好方法是什么?例如,查看我的数据正在使用多少内存,和/或哪些函数调用分配了最多的内存.

What's a good way to profile a PHP page's memory usage? For example, to see how much memory my data is using, and/or which function calls are allocating the most memory.

  • xdebug似乎没有在其概要分析功能中提供内存信息.

  • xdebug doesn't seem to provide memory information in its profiling feature.

xdebug 确实在其跟踪功能中提供了它.这与我想要的非常接近,除了庞大的数据量是压倒性的,因为它显示了每个单个函数调用的内存增量.如果可以使用某些GUI工具将呼叫隐藏到一定深度以下,那将解决我的问题.

xdebug does provide it in its tracing feature. This is pretty close to what I want, except the sheer amount of data is overwhelming, since it shows memory deltas for every single function call. If it were possible to hide calls below a certain depth, maybe with some GUI tool, that would solve my problem.

还有别的吗?

推荐答案

Xdebug 确保选择内存选项:)

Xdebug reimplemented memory tracing in 2.6 (2018-01-29) which can be used in Qcachegrind or similar tool. Just make sure to select the memory option :)

从文档中

自Xdebug 2.6起,探查器还将收集有关正在使用多少内存以及哪些功能可以提高内存使用率的信息.

Since Xdebug 2.6, the profiler also collects information about how much memory is being used, and which functions aGnd methods increased memory usage.

我不熟悉文件的格式,但是Qcachegrind在跟踪几个内存问题方面对我非常有用.

I'm not familiar with the format of the file, but it's Qcachegrind has worked great for me in tracing a couple memory issues.

这篇关于PHP内存分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆