Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.34k stars 4.16k forks source link

Android端,开启Vulkan后,内存占用持续上升 #3017

Open hzxsunshine opened 3 years ago

hzxsunshine commented 3 years ago

Hello, @nihui , 您好,我想请教一下 inference同一个模型,开启 use_vulkan_compute = true 后,用android studio Profiler 看内存占用持续上升,关闭Vulkan只用CPU做推理的话则没有这个问题。

Vulkan inference memory curve:

vulkan

CPU inference memory curve:

cpu

模型用的是

https://github.com/FeiGeChuanShu/ncnn_nanodet_hand 里面手部检测和手部关键点检测模型

我想请问一下,这个情况正常么? 它里面存在内存泄漏么?如果没泄漏,我怎么可以正确的回收vulkan在这之前allocate的内存呢?

DaChengTechnology commented 3 years ago
opt.lightmode=true;

试试这个

hzxsunshine commented 3 years ago
opt.lightmode=true;

试试这个

lightmode一直开着的:)

chenxiemin commented 3 years ago

我也遇到同样的问题,yolov5

chenxiemin commented 3 years ago

最新版的master应该解决了,可以测试看看

hzxsunshine commented 3 years ago

最新版的master应该解决了,可以测试看看

好的,谢谢提醒,我测测看