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

Fix OutOfMemory when fetching feed #10670

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Dec 20, 2023

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

This PR reduces the memory footprint of FeedUpdateInfo objects. They used to contain an originalInfo: Info field, which in turn contained the raw json of channel tabs embedded within ReadyChannelTabExtractors. This ended up using ~800KB per FeedUpdateInfo instance, which is not really that bad. However those objects might stay around for a while and accumulate (up to BUFFER_COUNT_BEFORE_INSERT = 20 at the moment), so in order not to fill up the memory it's better to keep as little data inside FeedUpdateInfo as possible. Since we don't really need access to originalInfo from FeedUpdateInfo, I just kept as little data as possible about the fetched channel.

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

Reduced memory footprint of FeedUpdateInfo objects. Those objects might stay around for a while and accumulate (up to BUFFER_COUNT_BEFORE_INSERT = 20 at the moment), so in order not to fill up the memory it's better to keep as little data as possible.
Previously ChannelInfo data was stored, causing ReadyChannelTabLinkHandler objects to be also stored uselessly (and those channel tabs contain prefetched JSON data which used ~700KB of memory).
@Stypox Stypox changed the title eFix OutOfMemory when fetching feed Fix OutOfMemory when fetching feed Dec 20, 2023
Copy link

sonarcloud bot commented Dec 20, 2023

@Stypox Stypox mentioned this pull request Dec 20, 2023
21 tasks
@AudricV AudricV added bug Issue is related to a bug feed Issue is related to the feed size/medium PRs with less than 250 changed lines labels Dec 21, 2023
@Stypox Stypox merged commit 4825318 into TeamNewPipe:release-0.26.0 Dec 21, 2023
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug feed Issue is related to the feed size/medium PRs with less than 250 changed lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants