当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- vivoY73s和vivoY70s的区别 vivoY73s和vivoY70s哪个值得入手
- M-end software product design considerations - Zhihu
- python 循环区分(while循环和for循环)
- TCP协议如何确保可靠传输
- Installing MacOS 11 Big Sur in virtual machine
- 函数周期表丨筛选丨值丨SELECTEDVALUE - 知乎
- Function periodic table filter value selectedvalue
- Distributed consensus mechanism
- 笔试面试题目:求丢失的猪
- AMD Zen3首发评测:频率超5GHz,IPC提升不止19%,这次真的Yes了 - 知乎
猜你喜欢
Game optimization performance (11) - Zhihu
来自不同行业领域的50多个对象检测数据集
Improvement of rate limit for laravel8 update
虚拟机中安装 macOS 11 big sur
[original] about the abnormal situation of high version poi autosizecolumn method
糟糕,系统又被攻击了
PCIe 枚举过程
技术人员该如何接手一个复杂的系统?
Cloud alibabab notes come out, the whole network detailed explanation only this one hand is slow
M 端软件产品设计思虑札记 - 知乎
随机推荐
Which is more worth starting with the difference between vivos7e and vivos7
分布式共识机制
笔试面试题目:求丢失的猪
[summary series] technical system of Internet server: high performance database index
运维人员常用到的 11 款服务器监控工具
Solve Safari browser download file name garbled problem
i5 1135g7和i5 1035g1参数对比区别大吗? 哪个好
Daily challenges of search engines_ 4_ External heterogeneous resources - Zhihu
【原创】关于高版本poi autoSizeColumn方法异常的情况
Cloud Alibabab笔记问世,全网详解仅此一份手慢无
Ulab 1.0.0 release
虚拟机中安装 macOS 11 big sur
python学习 day1——基础学习
Architect (November 2020)
Solve the problem of rabbitmq message loss and repeated consumption
PX4添加新的应用
An error occurred while starting the kernel was successfully resolved
Oops, the system is under attack again
PDMS cutting software
iOS 学习笔记二【cocopods安装使用和安装过程中遇到的问题及解决办法】【20160725更新】