-
Notifications
You must be signed in to change notification settings - Fork 231
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
WebImage in LazyVStack take massive memory #271
Comments
Does this only happen on iOS 17 ? |
I tested it on iOS16, both on simulator and iPhone device. @edolorenza |
Have a try with the latest v3.0.0-Beta or master branch ? Is this still reproducable ? |
Here is a full demo, which will load some images of cat, hope it helps. struct ImageBodyView: View {
@State var url: String
var body: some View {
VStack {
WebImage(url: URL(string: url))
.resizable()
}
}
}
struct ContentView: View {
@State private var imageURLList: [String] = []
var body: some View {
GeometryReader { geometryProxy in
VStack {
HStack{
Button("test load") {
self.imageURLList = (1..<100).map{ "https://cataas.com/cat?r="+String($0) }
}
Spacer()
Button("clear") {
self.imageURLList.removeAll()
}
}
ScrollView {
LazyVStack(spacing: 0) {
ForEach(self.imageURLList, id: \.self) { url in
ImageBodyView(url: url)
.scaledToFit()
.frame(width: geometryProxy.size.width)
}
}
}
}
}
.padding()
}
} |
I'm using a LazyVStack for my project and I can confirm that. CPU is between 90% - 98% during the scroll. |
Yes it do occur while scrolling the memory raises and unexpectedly gets crashed too. Please if you find something to release out the memory, do inform me too. |
Has there been an update on this? Facing something similar with AnimatedImage. |
Provide a demo ? |
I write a demo with SDWebImageSwiftUI, just put some images in a lazyVStack.
here is code for the demo:
this demo using a lots of memories, and it will keep growing while scrolling to the bottom. The memory will not release before I clean the imageUrlList.
The text was updated successfully, but these errors were encountered: