Scheduling of garbage collection
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- objective-c
- 领域
- mobile
调研方向
首先检查 SPTPersistentCache 现有的垃圾回收调度行为,以及应用进入后台时如何取消调度。确定调用方如何可靠地触发一次后台清理,并在定义好该手动清理路径且其调度和取消行为明确后,将此 issue 视为已解决。
由索引模型根据 Issue 内容生成。
描述
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!
- 主要语言
- Objective-C
- 星标
- 1.2k
- 派生
- 75
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
spotify/SPTPersistentCache 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 55/100
spotify/SPTPersistentCache#125 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 45/100
spotify/SPTPersistentCache#105 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
spotify/SPTPersistentCache#102 ·
-
难度 5/5 一周以上 新手友好度 20/100
spotify/SPTPersistentCache#99 · 3 条评论 ·
-
bug
难度 4/5 3-5 天 新手友好度 38/100
spotify/SPTPersistentCache#85 · 1 条评论 ·
查看 spotify/SPTPersistentCache 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
DataDog/dd-sdk-ios#3293 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
callstackincubator/voltra#340 ·
维护者通常 4 天内回复
-
Needs: Author Feedback Needs: Repro
难度 2/5 1-3 小时 新手友好度 76/100
react/react-native#58952 · 1 条评论 ·
维护者通常 1 天内回复
-
iOS: number-pad TextInput shows a toolbar with a "Default" button可能已有人在做 @Gauvino 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 83/100
SwiftOldDriver/iOS-Weekly#5454 ·