《天谕》手游的内存控制
(Github正常排版: 《天谕》手游的内存控制)
1. 资源内存
2. 脚本
3. 加载
4. 管理
1. 资源内存
- Profiler工具
- Unity
- Unity Profiler
- Memory->Take Sample Playmode(可以查看当前资源的内存占用)
- 新版本增加了Profiler (Standalone Process)(https://blog.csdn.net/zhenghongzhi6/article/details/106949795)
- Profile Analyer(package manager)
- Memory Profiler(package manager)
- https://www.cnblogs.com/lucater/p/12509219.html
- 抓帧:Frame Debugger
- Unity Profiler
- ios
- xcode
- 抓帧:xcode中的Instruments(https://www.jianshu.com/p/4d94a700de96)
- android
- 命令行dump(https://blog.csdn.net/jscese/article/details/37928823)
- Android Studio->Profiler
- 抓帧:Snapdragon(不同芯片可能不一样)/Renderdoc
- Unity
- 贴图
贴图是内存和包体的大头- 格式:
- 默认是ASTC8x8,部分需要高清用6x6或4x4(ASTC高质量,高压缩比,解析快,参数灵活)
- ios放弃iphone5s/ipadmini
- android给低端机单独打包(ETC2 8bits)
- 尺寸:
- 控制贴图尺寸,针对不同类型的尺寸缩放不同
- 如:Albedo对尺寸敏感较低,可缩小.Normal需要高清,则放大
- mipmap:
- UI关闭mipmap,否则多33%的占用
- Read/Write:
- 关闭贴图的Read/Write Enaled,否则CPU和GPU会各有一份内存
- 张数:
- 去掉重复冗余贴图,减少张数(用UWA检测)
- 合并通道(ASTC是按照block压缩的,对通道影响不大)
- 格式:
- Mesh
- 顶点数: