建议使用哪种PyPy内存分析器?

min*_*hee 7 profiler memory-management pypy

我可以使用哪些工具来监控PyPy的内存消耗?如果该工具可以移植到各种Python解释器(CPython和PyPy)和版本(2.6到3.3),那就更好了.

小智 1

我只知道一种分析器,它是由 python 社区本身提供的,内存分析器

您可以使用 pip 或 easy_install 下载它,

$ easy_install -U memory_profiler # pip install -U memory_profiler
Run Code Online (Sandbox Code Playgroud)

psutil是推荐与此分析器一起使用的模块。

如果你想从源代码安装它,

$ python setup.py install
Run Code Online (Sandbox Code Playgroud)

最新的来源可以在https://github.com/fabianp/memory_profiler上找到。

文档、示例、API 帮助可以在https://pypi.python.org/pypi/memory_profiler上找到。