当前位置:网站首页>A scheme to improve the memory utilization of flutter
A scheme to improve the memory utilization of flutter
2020-11-08 10:29:00 【InfoQ】
background
The image scheme we use is a self-developed external texture scheme :
- Android Side create SurfaceTexture, adopt FlutterJNI Sign up to Flutter engine in , Finally back to texture id to Flutter application layer , Application layer usage Texture Widget and textue id To show the texture of the image .
- Texture data is in Android Side , adopt OpenGL Write the image texture to SurfaceTexture, And then through Flutter engine Shared memory in , Passing texture data to the application layer , Finally handed over to Skia Rendering .

The problem is : Flutter The texture data of the application layer is not cached , Every time you need to put Bitmap Data is rendered into textures , Give it back Flutter Application layer usage .Native Image loading will cache memory ,Flutter The image library provided by itself also has a cache , this 2 The caches are isolated from each other , It takes up a lot of memory . and Flutter The image cache is basically a local resource map , And we Flutter Most of the pages are actually external texture images downloaded from the Internet , This leads to low utilization of cache resources .
analysis
For the above 3 A question , Let's get rid of technology and implement , Suppose you want to solve this 3 A question , What is the ideal solution :
- Texture has no cache , Then we add a texture memory cache in the application layer to solve the problem .
- When the upper application layer has already cached the texture , that Native On the side Bitmap Memory cache can also be removed , Keep only the disk cache of image resources .
- Whole App Memory cache , Only texture caching ,Flutter Of ImageCache cache , In order to avoid the waste of memory resources , Will this 2 One cache is combined into one
Link to the original text :【https://www.infoq.cn/article/4t9HrwJFvRh41X2328Gy】. Without the permission of the author , Prohibited reproduced .
版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
边栏推荐
- Function periodic table filter value selectedvalue
- PCIe enumeration process
- 211考研失败后,熬夜了两个月拿下字节offer!【面经分享】
- vivoy73s和荣耀30青春版的区别
- Search and replace of sed
- SQL Server 2008R2 18456 error resolution
- 虚拟机中安装 macOS 11 big sur
- 阅读心得:FGAGT: Flow-Guided Adaptive Graph Tracking
- Review the cloud computing application scenarios you didn't expect (Part 1)
- Flink的sink实战之一:初探
猜你喜欢

Adobe Prelude /Pl 2020软件安装包(附安装教程)

不多不少,大学里必做的五件事(从我的大一说起)

Face recognition: attack types and anti spoofing techniques

Game optimization performance (11) - Zhihu

SQL Server 2008R2 18456 error resolution

Bohai bank million level fines continue: Li Volta said that the governance is perfect, the growth rate is declining

ASP.NET MVC下基于异常处理的完整解决方案

M-end software product design considerations - Zhihu

Improvement of rate limit for laravel8 update

Japan PSE certification
随机推荐
Flink's sink: a preliminary study
笔试面试题目:求缺失的最小正整数
技术人员该如何接手一个复杂的系统?
Is there a big difference between i5 1135g7 and i51035g1? Which is better?
Px4 adds new applications
临近双11,恶补了两个月成功拿下大厂offer,跳槽到阿里巴巴
Python3.9的7个特性
Fgagt: flow guided adaptive graph tracking
Solve Safari browser download file name garbled problem
架构师(2020年11月)
搜索引擎的日常挑战_4_外部异构资源 - 知乎
AMD Zen3首发评测:频率超5GHz,IPC提升不止19%,这次真的Yes了 - 知乎
Solve the problem of rabbitmq message loss and repeated consumption
软件测试就是这么回事?!
211考研失败后,熬夜了两个月拿下字节offer!【面经分享】
双向LSTM在时间序列异常值检测的应用
仅用六种字符来完成Hello World,你能做到吗?
解决Safari浏览器下载文件文件名称乱码的问题
Adobe Prelude /Pl 2020软件安装包(附安装教程)
Function periodic table filter value selectedvalue