three_dart icon indicating copy to clipboard operation
three_dart copied to clipboard

The memory leakage is serious

Open 1136066873 opened this issue 2 years ago • 10 comments

Hello, I have tried using your library on my mobile phone and found that there is a serious memory leak problem. Specifically: After opening your Example, click on a model in the list, wait for the model to load, and then close the model details screen. If you do this for about 15 to 17 times, the app will leak up to 2 GB of memory and die in the OOM. This phenomenon is still very obvious, author you can try.

My test device information:

Equipment brand: 华为 Honor 8 Lite Device model: PRA-AL00 Device system version: Android 8.0.0 Device processor: Kirin 655 Operating memory: 3.0GB

Looking forward to reply

1136066873 avatar May 13 '22 03:05 1136066873

是的 应该是有内存泄露 flutter_gl内的NativeArray 和opengl 的各种buffer 估计都有 没有及时释放的情况 😄

wasabia avatar May 13 '22 13:05 wasabia

是的 应该是有内存泄露 flutter_gl内的NativeArray 和opengl 的各种buffer 估计都有 没有及时释放的情况 😄

你好,最近有修复计划吗 :)

1136066873 avatar May 13 '22 14:05 1136066873

是的 应该是有内存泄露 flutter_gl内的NativeArray 和opengl 的各种buffer 估计都有 没有及时释放的情况 😄

你好,最近有修复计划吗 :)

暂时没有 可以自己修复 😄

wasabia avatar May 13 '22 14:05 wasabia

是的 应该是有内存泄露 flutter_gl内的NativeArray 和opengl 的各种buffer 估计都有 没有及时释放的情况 😄

你好,最近有修复计划吗 :)

暂时没有 可以自己修复 😄

(O_o) 好的吧,谢谢及时反馈:)

1136066873 avatar May 13 '22 14:05 1136066873

一般都是用户自己管理内存释放的 所以 自己需要考虑, flutter_gl NativeArray 提供了dispose接口 example 根本没考虑这个 😄

wasabia avatar May 14 '22 02:05 wasabia

How to properly free a memory there?

ProgrammingLife avatar May 18 '22 13:05 ProgrammingLife

How to properly free a memory there?

NativeArray has dispose() can free memory

wasabia avatar May 18 '22 14:05 wasabia

我觉得Dart 2.17有NativeFinalizer以后可以考虑从这里入手,在garbage collect的时候一起把buffer给dispose掉。

GZGavinZhao avatar May 28 '22 17:05 GZGavinZhao

This will solve a lot of performance issues: https://github.com/wasabia/three_dart/pull/123

mark-nicepants avatar Mar 01 '23 07:03 mark-nicepants

This will solve a lot of performance issues: #123

There are still many places with memory leak.....

fordringd2008 avatar Nov 30 '23 09:11 fordringd2008