首页 > 解决方案 > 为什么 RealityKit 有如此高的脏内存占用?

问题描述

创建和加载一个纯新的 AR 项目,它只包含一个没有添加实体的 ARView,导致大约 330 MB 的脏内存(使用仪器中的 VM Tracker 检查)。

它真的很高,我想知道其他人是否也经历过这种情况。仅供参考,unity 的脏内存“只有”150 MB,这也很高。SceneKit 有 80 MB 的脏内存。

标签: swiftaugmented-realityarkitrealitykit

解决方案


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]

推荐阅读