Skip to content

Memory issue when caching too many GIFs in List / LazyVStack #172

Open
@tatsuz0u

Description

@tatsuz0u

Clearing memory caches manually doesn't help.
Reproduced in 2.0.0 & 2.0.1.

I used 70 gifs (5-7 MB each) to reproduce with my 4GB memory iPhone.

import SwiftUI
import SDWebImageSwiftUI

struct ContentView: View {
    let gifs = // bunch of gifs here
    
    var body: some View {
        ScrollView {
            LazyVStack {
                ForEach(gifs, id: \.hashValue) { gif in
                    WebImage(url: URL(string: gif))
                        .resizable()
                        .indicator(.progress)
                        .scaledToFit()
                }
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions