当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 临近双11,恶补了两个月成功拿下大厂offer,跳槽到阿里巴巴
- 5g/4g工业无线路由器
- 来自不同行业领域的50多个对象检测数据集
- How can a technician take over a complex system?
- Mate 40 series launch with Huawei sports health service to bring healthy digital life
- [computer network] learning notes, Part 3: data link layer (Xie Xiren version)
- 仅用六种字符来完成Hello World,你能做到吗?
- Is software testing training class easy to find a job
- More than 50 object detection datasets from different industries
- C++在C的基础上改进了哪些细节
猜你喜欢

Flink's sink: a preliminary study

Is there a big difference between i5 1135g7 and i51035g1? Which is better?

The young generation of winner's programming life, the starting point of changing the world is hidden around

学习小结(关于深度学习、视觉和学习体会)
![IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]](/img/3b/00bc81122d330c9d59909994e61027.jpg)
IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]

Installing MacOS 11 Big Sur in virtual machine

面部识别:攻击类型和反欺骗技术

第二次作业

Basic concepts of computer network (5) basic principles of local area network

临近双11,恶补了两个月成功拿下大厂offer,跳槽到阿里巴巴
随机推荐
M 端软件产品设计思虑札记 - 知乎
next.js实现服务端缓存
Flink的sink实战之一:初探
Tiktok live monitoring Api: random recommendation
SQL Server 2008R2 18456 error resolution
游戏优化性能杂谈(十一) - 知乎
Function periodic table filter value selectedvalue
What details does C + + improve on the basis of C
Fgagt: flow guided adaptive graph tracking
If you don't understand the gap with others, you will never become an architect! What's the difference between a monthly salary of 15K and a monthly salary of 65K?
虚拟机中安装 macOS 11 big sur
Game optimization performance (11) - Zhihu
Web novice problem of attacking and defending the world
Visual Studio 2015 未响应/已停止工作的问题解决
How can a technician take over a complex system?
python学习 day1——基础学习
Flink's sink: a preliminary study
Application of bidirectional LSTM in outlier detection of time series
Game mathematical derivation AC code (high precision and low precision multiplication and division comparison) + 60 code (long long) + 20 point code (Full Permutation + deep search DFS)
print( 'Hello,NumPy!' )