firefox-ios icon indicating copy to clipboard operation
firefox-ios copied to clipboard

Part 2 - Replace SDWebImage with Kingfisher to stop Firefox from crashing when opening some PDF which causes memory pressure

Open data-sync-user opened this issue 3 years ago • 3 comments

This is Part 2 of the replacement ticket:

  1. Add operation to clear SD WebImage cache and add Glean report so we are able to track its progress and eventually remove the library in the next few releases
  2. Add mechanism to limit kingfisher cache to a certain percentage of the device memory otherwise, the disk cache can easily become bloated - This is already done by KF, and by default the mem cache is 25% of the total memory and the disk cache gets cleared after 7 days: https://github.com/onevcat/Kingfisher/wiki/New-In-Kingfisher-5

Steps to reproduce

Opening the link to this PDF crashes Firefox: https://www.makochicago.com/s/20220421-Mako-Menu.pdf

Reference Tickets and PRs:

Part 1: https://mozilla-hub.atlassian.net/browse/FXIOS-4285

Part 2: https://mozilla-hub.atlassian.net/browse/FXIOS-4321

Part 3: https://mozilla-hub.atlassian.net/browse/FXIOS-4533

Part 4: https://mozilla-hub.atlassian.net/browse/FXIOS-4532

Expected behavior

PDF loads.

Actual behavior

Firefox crashes to home screen after 1-2 seconds.

Device & build information

  • Device: iPhone 11 max pro /iOS 15.4.1
  • Build version: FF Daylight 101.1 (9384)

*# *## Notes Attachments:

┆Issue is synchronized with this Jira Task

data-sync-user avatar Jun 02 '22 16:06 data-sync-user

➤ Nishant Bhasin commented:

Made a PR related to some of the work along with two more tickets for Part 3 and Part 4 so we can do the work in a more organized manner.

In the PR below we added SDWebImage clear disk cache on background and add counter for tracking KF migration

https://github.com/mozilla-mobile/firefox-ios/pull/11169 ( https://github.com/mozilla-mobile/firefox-ios/pull/11169|smart-link )

data-sync-user avatar Jul 12 '22 15:07 data-sync-user

➤ Simion Basca commented:

Nishant Bhasin should we start testing this or should we wait for all the work (3 and 4) to be finished to start testing?

data-sync-user avatar Aug 04 '22 13:08 data-sync-user

➤ Nishant Bhasin commented:

Simion Basca you can start testing this as of v103.0

The work 3) and 4) and to add tests etc

data-sync-user avatar Aug 04 '22 14:08 data-sync-user

➤ Catalin Suciu commented:

Tested this on latest main and didn’t experienced any regressions. Verifying the issue as fixed.

data-sync-user avatar Aug 22 '22 13:08 data-sync-user