Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks when using ImageProgressive #2299

Open
3 tasks done
james-app opened this issue Oct 9, 2024 · 1 comment
Open
3 tasks done

Memory leaks when using ImageProgressive #2299

james-app opened this issue Oct 9, 2024 · 1 comment

Comments

@james-app
Copy link

james-app commented Oct 9, 2024

Check List

Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.

Issue Description

What

When we download JPG image with progressive option, we have memory leaks, watched by Xcode Instruments.

Reproduce

Just simple class to reproduce:

import Kingfisher
import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var imageView: UIImageView!
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }

    @IBAction func downloadTap(_ sender: Any) {
        guard let url = URL(string: "https://images.contenthub.dev/bali6j22f8ll/733291a9e9679715889ddaf1e238166d/Finkenberg.jpg?fit=fill&f=center&fm=jpg&fl=progressive&q=85&w=943") else {
            return
        }
        let resource: Resource = KF.ImageResource(downloadURL: url)
        let options: KingfisherOptionsInfo =  [.progressiveJPEG(ImageProgressive())]

        // No memory leaks
//        imageView.kf.setImage(with: resource)
        
        // Memory leaks
        imageView.kf.setImage(with: resource, options: options)
    }
    
}

Other Comment

Attaching image and trace from Xcode Instruments.
kingfisher-memory-leaks.trace.zip
Screenshot 2024-10-09 at 09 59 22

@Adobels
Copy link

Adobels commented Nov 11, 2024

The described memory leak is reproducible in the JPEG Progression Scene of the 'Demo' project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants