Hi,
I've noticed similar behaviour on the iOS 16 Beta and was able to isolate it down into a really simple project.
This is happening on iOS 16.0 (20A5312j) and Xcode Version 14.0 beta 3 (14A5270f). On iOS 15 things appear to be working fine.
Apparently this only happens with dynamically generated meshes, not for example when loading a model from a USDZ.
Nevertheless it seems like a pretty critical bug and causes constant memory ramp up for me.
FB Number with sample project: FB10806403
import UIKit
import RealityKit
class ViewController: UIViewController {
// if I change this to let arView = ARView() there is no memory leak
lazy var arView = ARView()
override func loadView() {
view = arView
}
override func viewDidLoad() {
super.viewDidLoad()
let boxSize: SIMD3<Float> = .init(repeating: 0.3)
// ↓ just allocating this MeshResource creates a leak on iOS 16
let _: MeshResource = .generateBox(
width: boxSize.x,
height: boxSize.y,
depth: boxSize.z
)
}
}
Setup:
Leak:
Topic:
Graphics & Games
SubTopic:
RealityKit
Tags: