谷歌堆分析器和实际内存使用中的内存统计差异

问题描述

我的 python 稳定使用 17GB 内存。

10705 hadoop-+  20   0 33.453g 0.016t  93024 S 405.1  6.5   4560:23 python main.py

但谷歌堆分析器告诉:

Total: 1354.5 MB
   282.9  20.9%  20.9%    282.9  20.9% std::string::_M_mutate
   180.9  13.4%  34.2%    406.0  30.0% tensorflow::OpKernel::OpKernel
   ....

我确定我的 top 是正确的,所以我认为我在使用 google heap profiler 时出现了错误

我的分析器代码

export LD_PRELOAD="`pwd`/tf_venv/libcudnn/libtcmalloc.so"
HEAPPROFILE=/tmp/test.prof python main.py $*

我的 tcmalloc 版本:4.1.0

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)