swift - 为什么 RealityKit 有如此高的脏内存占用?
问题描述
创建和加载一个纯新的 AR 项目,它只包含一个没有添加实体的 ARView,导致大约 330 MB 的脏内存(使用仪器中的 VM Tracker 检查)。
通过添加以下行可以很容易地观察到这一点:
arView.debugOptions = [.showStatistics]
它真的很高,我想知道其他人是否也经历过这种情况。仅供参考,unity 的脏内存“只有”150 MB,这也很高。SceneKit 有 80 MB 的脏内存。
解决方案
That's because all RealityKit's "hard core" options are ON by default. For lowering memory footprint you need to turn off "hard core" options and RealityKit app will be working considerably "smoother".
let arView = ARView(frame: .zero)
arView.renderOptions = [.disableMotionBlur,
.disableDepthOfField,
.disablePersonOcclusion,
.disableGroundingShadows,
.disableFaceOcclusions,
.disableHDR]
推荐阅读
- ionic-framework - 离子菜单的推送和显示类型不起作用
- android - Why my app opens wrong folder in filemanager dialog?
- sql - 如何检索包内的方法类型?
- apache-poi - 如何附加现有表?
- vue.js - VUE js 在不同的组件层次结构中调用子组件方法
- amazon-web-services - 将弹性 IP 地址分配给现有/正在运行的 Amazon EC2 实例
- ios - 如何获得 App Store 上可用的任何应用程序的 IPA?(旧方法行不通)
- javascript - 如何在 react-google-maps 中嵌入 textview?
- pandas - 将 Pandas 交叉表数据框绘制成 3D 条形图
- kubernetes - 更新 Kubernetes 作业:会发生什么?