Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Scheduling of garbage collection

未关闭
#89 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@joelekstrom 已经在做这个了。

开始于 2017年3月14日。

  • #90 来自 @joelekstrom —— 未关闭

评估

难度
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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

spotify/SPTPersistentCache 的其他 Issue

查看 spotify/SPTPersistentCache 的全部 Issue

相似的 Issue

更多 Objective-C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。