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

iOS memory leaks when render WebP images #738

Open
Stafox opened this issue Oct 24, 2020 · 13 comments
Open

iOS memory leaks when render WebP images #738

Stafox opened this issue Oct 24, 2020 · 13 comments
Labels

Comments

@Stafox
Copy link

Stafox commented Oct 24, 2020

Describe the bug
I use the library to render WebP images inside FlatList. Number of images about 100.
Have see memory leaks like described here #622 and here #560

Looks like issue connected with [SDWebImage/SDWebImageWebPCoder] (discussion here)(https://github.com/SDWebImage/SDWebImageWebPCoder).

To Reproduce
Render WebP images inside your application.

Expected behavior
No memory leaks while WebP images are rendering.

Dependency versions

  • React Native version: 0.63.3
  • React version: 16.14.0
  • React Native Fast Image version: 8.3.2
@MiguelGrability
Copy link

Hi, We've been dealing with a memory leaks reports from sentry related with SDWebImage and SDWebImageDownloaderOperation

Have you considered to upgrade SDWebImage and SDWebImageWebPCoder to the latest version?

@Stafox
Copy link
Author

Stafox commented Dec 7, 2020

Of course,
I've created an issue here to update dependencies in the future.

There is an issue SDWebImage/SDWebImageWebPCoder#46

@lhb11
Copy link

lhb11 commented Dec 21, 2020

有解决办法吗?同求
Is there a solution? Seeking the same

@Stafox
Copy link
Author

Stafox commented Dec 21, 2020

有解决办法吗?同求
Is there a solution? Seeking the same

No yet. I think you can put +1 here

@mikecfisher
Copy link

How are you guys even getting WebP to work? I'm on 8.3.4 and I can't even load WebP images.

@baronha
Copy link

baronha commented Jun 25, 2021

I used to use FastImage to support webp. But it takes up too much memory. How to solve it

@amalmohann
Copy link

FastImage memory leak issue when loading webp images, any fixes or alternative for this?

@Stafox
Copy link
Author

Stafox commented Oct 20, 2022

@amalmohann any evidence? Profiler results?
As for me there is no issue starting iOS 14 because it uses native webp codec. So I just up required minimal iOS version to 14.0

@amalmohann
Copy link

@Stafox i was testing this in iPhone 12. my phone got heated up and after a while it closed with memory exception. Once removed the package everything went back to normal and haven't had any issue since. But now the image loading is very slow.

@Stafox
Copy link
Author

Stafox commented Oct 20, 2022

maybe problem with you unoptimized flatlist or whatever you use. So, debug it and share iOS profiler results to see what exactly leaks. Information about number of images on screen also can be helpful. Otherwise do not expect that it can be fixed without steps of reproduce.

@alexrequelme
Copy link

I have a similar problem with Flatlist and infinite scroll, the ram increase while scrolling, and then the app crashed.

@invyctus92
Copy link

invyctus92 commented Apr 7, 2023

Maybe I solved it by updating the graphics library used on iOS, just update the following file found in the react-native-fast-image library with the new versions, and run the pod update command on the iOS folder
file RNFastImage.podspec

require 'json'

Pod::Spec.new do |s|
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

  s.name          = "RNFastImage"
  s.version       = package['version']
  s.summary       = package['description']
  s.authors       = { "Dylan Vann" => "dylan@dylanvann.com" }
  s.homepage      = "https://github.com/DylanVann/react-native-fast-image#readme"
  s.license       = "MIT"
  s.platforms     = { :ios => "8.0", :tvos => "9.0" }
  s.framework     = 'UIKit'
  s.requires_arc  = true
  s.source        = { :git => "https://github.com/DylanVann/react-native-fast-image.git", :tag => "v#{s.version}" }
  s.source_files  = "ios/**/*.{h,m}"

  s.dependency 'React-Core'
  s.dependency 'SDWebImage', '~> 5.15.5'
  s.dependency 'SDWebImageWebPCoder', '~> 0.11.0'
end

@rabbitmouse
Copy link

I have the same problem, the FFFastImageView is not being released, does anyone know how to fix it?

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

No branches or pull requests

9 participants