当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Flink的sink实战之一:初探
- M-end software product design considerations - Zhihu
- 攻防世界之web新手题
- An error occurred while starting the kernel was successfully resolved
- Unparseable date: 'mon Aug 15 11:24:39 CST 2016', time format conversion exception
- C++在C的基础上改进了哪些细节
- Visual Studio 2015 未响应/已停止工作的问题解决
- 狗狗也能操作无人机!你没看错,不过这其实是架自动驾驶无人机 - 知乎
- Cloud alibabab notes come out, the whole network detailed explanation only this one hand is slow
- Application of bidirectional LSTM in outlier detection of time series
猜你喜欢
Web novice problem of attacking and defending the world
print( 'Hello,NumPy!' )
vivoY73s和vivoY70s的区别 vivoY73s和vivoY70s哪个值得入手
架构师(2020年11月)
狗狗也能操作无人机!你没看错,不过这其实是架自动驾驶无人机 - 知乎
AMD Zen3首发评测:频率超5GHz,IPC提升不止19%,这次真的Yes了 - 知乎
Insight -- the application of sanet in arbitrary style transfer
笔试面试题目:求缺失的最小正整数
SQL Server 2008R2 18456错误解决方案
阅读心得:FGAGT: Flow-Guided Adaptive Graph Tracking
随机推荐
Web novice problem of attacking and defending the world
2020-11-05
How TCP protocol ensures reliable transmission
学习小结(关于深度学习、视觉和学习体会)
PCIe 枚举过程
2天,利用下班后的4小时开发一个测试工具
Improvement of rate limit for laravel8 update
ArrayList源码分析
Unparseable date: 'mon Aug 15 11:24:39 CST 2016', time format conversion exception
Deeplight Technology Bluetooth protocol SRRC certification services
成功解决An error ocurred while starting the kernel
将“光头”识别为“足球”,AI 摄像头如何犯的错?
ASP.NET MVC下基于异常处理的完整解决方案
Which is more worth starting with the difference between vivos7e and vivos7
Can you do it with only six characters?
sed之查找替换
Mozi college SQL injection solution
来自不同行业领域的50多个对象检测数据集
软件测试培训班出来好找工作么
数据科学面试应关注的6个要点