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 usage in iOS 17 #266

Open
Cyclic opened this issue Jun 11, 2023 · 1 comment
Open

Memory usage in iOS 17 #266

Cyclic opened this issue Jun 11, 2023 · 1 comment

Comments

@Cyclic
Copy link

Cyclic commented Jun 11, 2023

Hello,

We are running an app on iOS 17 with lots of images, and most of them are around 50K - 100K on disk. However, as you can see from the attached image, they are much larger in memory. In addition, SDWebImageSwiftUI does not appear to be releasing the memory as it once did. Has something been introduced that might have caused this other than iOS 17? It’s also worth noting that many of the images are either in a list or scroll view with a lazyvstack.

Thank you,

image

image

@dreampiggy
Copy link
Collaborator

I think this is just the pre-render using the native UIKit method. If this does not match what you want ? You can disable this pre-force-decode feature via avoidDecodedImage to use decode just on time

See:

SDWebImageManager.shared.optionsProcessor = SDWebImageOptionsProcessor() { url, options, context in
    // Disable Force Decoding in global, may reduce the frame rate
    var mutableOptions = options
    mutableOptions.insert(.avoidDecodeImage)
    return SDWebImageOptionsResult(options: mutableOptions, context: context)
}

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