首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

memory_profiler的使用

作用:memory_profiler是用来分析每行代码的内存使用情况 使用方法一:    1.在函数前添加 @profile         2.运行方式: python -m memory_profiler...memory_profiler_test.py        此方法缺点:在调试 和 实际项目运行时 要 增删 @profile 此装饰器 代码如下: 1 #coding:utf8 2 3 @...memory_profiler_test.py 100000 Filename: memory_profiler_test.py Line # Mem usage Increment...            参数含义:precision:精确到小数点后几位                   stream:此模块分析结果保存到 'memory_profiler.log' 日志文件。...1 #coding:utf8 2 from memory_profiler import profile 3 4 @profile(precision=4,stream=open('memory_profiler.log

2.6K50

cpu分析利器 — async-profiler

简介 async-profiler是一款采集分析java性能的工具,翻译一下github上的项目介绍: ❝async-profiler是一款没有Safepoint bias problem的低开销java...❞ 使用方法 首先下载async-profiler,github主页(https://github.com/jvm-profiling-tools/async-profiler)上有已经编译好的文件,...基本用法 下载好的文件解压后,有一个profiler.sh脚本,运行脚本即可对java进程进行cpu分析,例如java进程id为1232 ./profiler.sh start 1232 ..../profiler.sh stop 1232 或者可以用-d指定剖析的时间(秒) ./profiler.sh -d 30 1232 执行完成后会输出采集的信息: ?...原理介绍 看到这里相信你应该会用async-profiler来进行cpu剖析了,如果感兴趣可以了解下async-profiler实现的原理,这块有一篇文章介绍的很详细,可以参考 ❝《JVM CPU Profiler

2.5K42
领券