CIDetector won't release memory - swift

2020-07-18 11:09发布

问题:

After the face detection is done the memory will not release, is there is a way I could release it (the memory stay at 300MB after the process is done).

 autoreleasepool{
  manager.requestImageData(for: asset, options: option){
        (data, responseString, imageOriet, info) in
        if (data != nil){

            //let faces = (faceDetector?.features(in: CIImage(data: data!)!))
            guard let faces = self.faceDetector?.features(in: CIImage(data: data!)!) else {
                return
            }

            completionHandler((faces.count))

        }else{
            print(info)
        }
        }
    }