RoomPlan - The delegate of ARSession is retaining x ARFrames

Hi,

I'm encountering an issue in our app that uses RoomPlan and ARsession for scanning. After prolonged use—especially under heavy load from both the scanning process and other unrelated app operations—the iPhone becomes very hot, and the following warning begins to appear more frequently:

"ARSession <0x107559680>: The delegate of ARSession is retaining 11 ARFrames. The camera will stop delivering camera images if the delegate keeps holding on to too many ARFrames. This could be a threading or memory management issue in the delegate and should be fixed."

I was able to reproduce this behavior using Apple’s RoomPlanExampleApp, with only one change: I introduced a CPU-intensive workload at the end of the startSession() function:

        DispatchQueue.global().asyncAfter(deadline: .now() + 5) {
            for i in 0..<4 {
                var value = 10_000
                DispatchQueue.global().async {
                    while true {
                        value *= 10_000
                        value /= 10_000
                        value ^= 10_000
                        value = 10_000
                    }
                }
            }
        }

I suspect this is some RoomPlan API problem that's why a filed an feedback: 17441091

RoomPlan - The delegate of ARSession is retaining x ARFrames
 
 
Q