Swift5 MacOS ImageResize memory issue
问题 I am new to Mac OS App Development with Swift. But I tried to make the simple ImageResizer app. I have to resize 50k images. After 10 hours, the memory has increased to nealy 120GB. I thought Swift also has Garbage collector. Why does it increase memory? I will show you my code. for i in 0..<paths.count { let path = paths[i] if let image = NSImage(contentsOf: path) { ... if self.resize(image: image, size: size, to: URL(fileURLWithPath: resizedImagePath)) { print("Image saved to \