[Content removed]
你好,我针对这个post做一下补充(这个问题close了重新开一个),我们在5.6.1的引擎上打了一个安卓shipping包,在poco f5上重新做了一次测试,发现内存泄漏的问题仍然存在
[Image Removed]
我们就5.4的工程和小米那边沟通过,小米那边和高通沟通过之后给了以下的回答,和你们同步一下:
From the KGSL traces, I can observe that the application renderthread is only allocating the memory but not freeing it -
<br/>
56978.841622: kgsl_mem_mmap: useraddr=0x70a18c1000 gpuaddr=0x40001d3000 size=4096 usage=any(0) id=427 flags=0xc0000
56978.841699: kgsl_mem_mmap: useraddr=0x70a18c1000 gpuaddr=0x40000b6000 size=4096 usage=any(0) id=296 flags=0xc0000
56978.841980: kgsl_mem_mmap: useraddr=0x70a13bc000 gpuaddr=0x40000b8000 size=4096 usage=gl id=338 flags=0xc0900
56978.842037: kgsl_mem_mmap: useraddr=0x70a13bc000 gpuaddr=0x40000ac000 size=4096 usage=any(0) id=49 flags=0xc0000
56978.842228: kgsl_mem_mmap: useraddr=0x70a13b9000 gpuaddr=0x40000d2000 size=4096 usage=texture id=316 flags=0xc0600
56978.842283: kgsl_mem_mmap: useraddr=0x70a13b9000 gpuaddr=0x40000d9000 size=4096 usage=gl id=343 flags=0xc0900
56978.842514: kgsl_mem_mmap: useraddr=0x70a1365000 gpuaddr=0x40000d8000 size=4096 usage=any(0) id=337 flags=0xc0000
56978.842572: kgsl_mem_mmap: useraddr=0x70a1365000 gpuaddr=0x40000cb000 size=4096 usage=texture id=292 flags=0xc0600
56994.002996: kgsl_mem_mmap: useraddr=0x70a18c1000 gpuaddr=0x40001d3000 size=4096 usage=any(0) id=427 flags=0xc0000
56994.003343: kgsl_mem_mmap: useraddr=0x70a18bb000 gpuaddr=0x40000d8000 size=4096 usage=any(0) id=337 flags=0xc0000
56994.003488: kgsl_mem_mmap: useraddr=0x70a18bb000 gpuaddr=0x40000d2000 size=4096 usage=texture id=316 flags=0xc0600
<br/>
For every kgsl_mem_mmap, there should be a corresponding kgsl_mem_free. // You can capture the KGSL traces for any other usecase and confirm the same.
<br/>
So, My suspsicion is that application might calling the memory free APIs to free up the memory or the memory free APIs might be called at a later point of time which is exceeding your usecase profiling duration.
<br/>
To summarize, GPU will only ne responsible to free/allocate the memory as per application request. If the application doesnot free the memory, GPU will not be explicitly freeing the application memory.
看起来像是猜测说内存的回收可能是在某个条件下统一进行,在5.6.1的项目中进行测试大概录制了10分钟,造成了16mb(图中的129331200,猜测单位是bit)的内存没有回收。
想请问下有没有可能是因为内存回收的滞后导致的这个现象?还是说可能有其他的原因导致的泄露?
我们会针对手头其他的机型接着做其他的测试,看下是否其他型号的GPU能够复现。