Scheduling of garbage collection
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- objective-c
- Domain
- mobile
Research direction
Start by reviewing SPTPersistentCache's existing garbage-collection scheduling behavior and how it is unscheduled when the app enters the background. Determine how a caller could trigger one background cleanup reliably, and consider the issue resolved when that manual cleanup path is defined and its scheduling and cancellation behavior is clear.
Written by the indexing model from the issue text.
Description
I'm considering how to schedule the garbage collector for an app that does not have long sessions. I understand that the current way of scheduling works fine for Spotify, since your app will be long running in the background.
Do you guys have any suggestions on how to handle scheduling in an app where the average user session is around 20 seconds? Scheduling it to run every 10 seconds seems unnecessary, but scheduling it to run at > 20 seconds could mean that the GC never runs for some users (since we need to unschedule when the app enters the background, to avoid an NSTimer keeping the app awake).
I think ideally, SPTPersistentCache should have a way to manually start the GC instead of scheduling it. This would allow us to run it once when the app enters background before it gets terminated.
I could achieve this in the current way by scheduling it at 0 seconds when the app enters background, and then immediately unscheduling it. This seems kind of insecure though, since it could run 10 times or even cancel before it runs at all.
Any input is appreciated!
- Dominant language
- Objective-C
- Stars
- 1.2k
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spotify/SPTPersistentCache
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
spotify/SPTPersistentCache#125 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
spotify/SPTPersistentCache#105 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
spotify/SPTPersistentCache#102 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
spotify/SPTPersistentCache#99 · 3 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 38/100
spotify/SPTPersistentCache#85 · 1 comment ·
All issues in spotify/SPTPersistentCache
Similar issues
-
Suzhou subway logo OpenIcons Metro Public Transport
Difficulty 1/5 Under an hour Newbie friendliness 75/100
organicmaps/organicmaps#13617 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
objective-see/LuLu#925 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
obsproject/obs-studio#13918 ·