Memory Profiler - Python 程序内存占用分析工具-python

时间:2021-06-18 18:31:39
【文件属性】:
文件名称:Memory Profiler - Python 程序内存占用分析工具-python
文件大小:148KB
文件格式:ZIP
更新时间:2021-06-18 18:31:39
性能优化 Memory Profiler - Python 程序内存占用分析工具 Memory Profiler 这是一个python模块,用于监控进程的内存消耗以及python程序的内存消耗的逐行分析。 它是一个纯 python 模块,它依赖于 psutil 模块。 安装 通过 pip 安装: $ pip install -U memory_profiler 该包也可以在 conda-forge 上获得。 要从源代码安装,请下载包,解压并输入: $ python setup.py install 用法 逐行内存使用 逐行内存使用模式的使用方式与 line_profiler 的使用方式大致相同:首先装饰您想使用@profile 分析的函数,然后使用特殊脚本(在这种情况下使用 Python 解释器的特定参数)运行脚本。 在下面的例子中,我们创建了一个简单的函数 my_func 来分配列表 a, b 然后删除 b:@profile def my_func(): a = [1] * (10 ** 6) b = [2] * (2 * 10 ** 7) del b return a if __na
【文件预览】:
memory_profiler-master
----MANIFEST.in(53B)
----.travis.yml(267B)
----README.rst(18KB)
----images()
--------flamegraph.png(61KB)
--------trend_slope.png(56KB)
----memory_profiler.py(47KB)
----test()
--------test_tracemalloc.py(1KB)
--------test_global.py(69B)
--------test_attributes.py(254B)
--------test_nested.py(427B)
--------test_mprof.py(463B)
--------test_exit_code.py(1KB)
--------test_memory_usage.py(2KB)
--------test_as.py(104B)
--------__init__.py(22B)
--------test_loop_decorated.py(453B)
--------test_async.py(339B)
--------test_gen.py(1KB)
--------test_unicode.py(242B)
--------test_precision_command_line.py(748B)
--------test_mprofile.py(959B)
--------test_exception.py(267B)
--------test_stream_unicode.py(293B)
--------test_func.py(170B)
--------test_loop.py(422B)
--------test_import.py(179B)
--------test_increment_display.py(2KB)
--------test_precision_import.py(842B)
----examples()
--------exxample_psutil_memory_full_info.py(5KB)
--------example.py(177B)
--------numpy_example.py(398B)
--------example_undecorated.py(185B)
--------reporting_logger.py(841B)
--------reporting_file.py(336B)
--------plot_memory.py(391B)
--------multiprocessing_example.py(1KB)
----setup.py(1KB)
----.gitignore(156B)
----Makefile(784B)
----README_DEV.rst(275B)
----COPYING(2KB)
----mprof.py(33KB)

网友评论