当前位置:网站首页>RTC 性能自动化工具在内存优化场景下的实践
RTC 性能自动化工具在内存优化场景下的实践
2022-07-25 18:17:00 【InfoQ】
背景介绍
- 哪些模块消耗多少内存?
- 如何优化?
内存组成
- Java Heap,从 Java 代码分配的对象;通话过程中 Java 内存的分布曲线,主要呈锯齿状的周期性变化。结合 VolcRTC 的业务特点,可以知道这部分内存主要在 JNI 调用时分配临时对象,累计到一定程度后由系统的 GC 机制回收。

- Native Heap,从 C 或 C++ 代码分配的对象。这部分为 VolcRTC 主要内存占用。

- Code,用于处理代码和资源(如 dex 字节码、经过优化或编译的 dex 代码、.so 库和字体)的内存。VolcRTC 库所占用内存,但不等于动态库的包大小,主要原因在于代码段是按需分页加载的,所以部分代码不会被加载到内存。VolcRTC 是一个动态库,因此 Code 的内存也是在通话过程中主要部分。

优化方向
- Native 内存优化
- 动态库包体优化
内存归因分析
- 内存分配堆栈信息
- 按模块归因
Heapprofd 实现原理
- hook malloc、calloc、realloc、free 等内存分配相关的函数
- 拷贝寄存器与栈内存,存储到共享内存,用于栈回溯
- 根据堆栈信息聚类生成 Trace 文件

模块归因

__pthread_start(void*)
碰到的问题

语音通话内存分析
内存优化
编译优化
按需动态分配
- 合理代码组件化,将不同的功能抽象成组件做到灵活组装与按需加载,如:AI 降噪功能内置的数据和模型会占用较大的内存空间。
- 内存尽量按需动态分配。如:AEC 回声消除在不同场景下有不同的算法,需要根据实际的场景按需分配内存,减少过多的内存预分配。
设置合理的缓存大小
合理的算法和数据结构设计
short优化效果
1v1 语音通话
- 构造稳定的测试用例
- 建立性能折损的数据归因模型
- 基于归因模型识别热点性能问题,形成优化方案
- 从 1v1 通话开始分析,然后逐步到多人、百人千人。
加入我们
参考文档:
边栏推荐
猜你喜欢

Auditing相关注解

云VR:虚拟现实专业化的下一步

Creation of unity Bezier curve

Sorting also needs to know the information and linked list

Ch582 ble 5.0 uses Le coded broadcast and connection

Keil5 “Loading PDSC Debug Description Failed for STMicroelectronics STM32Hxxxxxxx”解决办法

1--- electronic physical cognition

二叉树的相关操作

Introduction to cloud XR and development opportunities of cloud XR in 5g Era

ORB_ Slam3 recurrence - Part I
随机推荐
Use of LCD screen of kendryte k210 on FreeRTOS
Oracle import error: imp-00038: unable to convert to environment character set handle
ORB_ Slam3 recurrence - Part I
Who is responsible for the problems of virtual idol endorsement products?
专访即构科技李凯:音视频的有趣、行业前沿一直吸引着我
Keil5 "loading PDSC debug description failed for STMicroelectronics stm32hxxxxxxx" solution
List conversion problem
大话DevOps监控,团队如何选择监控工具?
“Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0”问题解决
What are the advantages of real-time cloud rendering
Recommend a qinheng Bluetooth reference blog
Related operations of binary tree
Itextpdf realizes the merging of multiple PDF files into one PDF document
基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现
Joseph Ring problem
Oracle使用impdp导入报错:ORA-39001: 参数值无效 ORA-39000: 转储文件说明错误 ORA-39088: 文件名不能包含路径说明
Talking about Devops monitoring, how does the team choose monitoring tools?
BL602 开发环境搭建
testng执行顺序的3中控制方法
Leetcode 101. symmetric binary tree & 100. same tree & 572. Subtree of another tree