当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- ArrayList源码分析
- IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]
- laravel8更新之速率限制改进
- Recommend an economic science video, very valuable!
- Solve the problem of rabbitmq message loss and repeated consumption
- TCP协议如何确保可靠传输
- Flink's sink: a preliminary study
- Improvement of rate limit for laravel8 update
- 【原创】关于高版本poi autoSizeColumn方法异常的情况
- Rust:命令行参数与环境变量操作
猜你喜欢
print( 'Hello,NumPy!' )
Python3.9的7个特性
Cloud Alibabab笔记问世,全网详解仅此一份手慢无
It's 20% faster than python. Are you excited?
临近双11,恶补了两个月成功拿下大厂offer,跳槽到阿里巴巴
盘点那些你没想到的云计算应用场景(上)
More than 50 object detection datasets from different industries
Distributed consensus mechanism
狗狗也能操作无人机!你没看错,不过这其实是架自动驾驶无人机 - 知乎
[original] about the abnormal situation of high version poi autosizecolumn method
随机推荐
PCIe 枚举过程
笔试面试题目:求丢失的猪
个人目前技术栈
成功解决An error ocurred while starting the kernel
我们采访了阿里云云数据库SQL Server的产品经理,他说了解这四个问题就可以了...
PX4添加新的应用
ASP.NET A complete solution based on exception handling in MVC
抖音直播监控Api:随机推荐
来自不同行业领域的50多个对象检测数据集
The difference between vivoy 73s and glory 30 Youth Edition
虚拟机中安装 macOS 11 big sur
Face recognition: attack types and anti spoofing techniques
PCIe enumeration process
Spotify是如何推动数据驱动决策的?
你搞不懂与别人的差距,永远成不了架构师!月薪15K和月薪65K,你差在那了?
不多不少,大学里必做的五件事(从我的大一说起)
Is software testing training class easy to find a job
python_scrapy_房天下
AMD Zen3首发评测:频率超5GHz,IPC提升不止19%,这次真的Yes了 - 知乎
211 postgraduate entrance examination failed, stay up for two months, get the byte offer! [face to face sharing]