CIDetector drains mac memory

Hello everyone,

Everything was working good until I updated to mac OS Monterey, once I finish the update, I did check the app and it start to consume a lot of memory, the app starts in 35MB and 3 seconds later grows to 345, then 650mb then 780 and so on.

I don't know if someone is experimenting the same but your help to solve this will be very appreciated, thank you.

This is the code for that:

let detector = CIDetector(     ofType: CIDetectorTypeQRCode,     context: nil,     options: [CIDetectorAccuracy: CIDetectorAccuracyLow, CIDetectorTracking: false]  )

guard let features = detector?.features(in: ciimage) else {       return decode }

for feature in features as! [CIQRCodeFeature] {       decode = feature.messageString! }

CIDetector drains mac memory
 
 
Q