We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
me.him188.ani.app.ui.subject.episode.EpisodeViewModel#getPageState 里面创建 MediaSourceResultsPresentation 会传入 backgroundScope.coroutineContext.
而 MediaSourceResultsPresentation 会在这个 context 下 launch job, 导致 presentation 对象 leak (这涉及整个数据源匹配链路上的所有对象). 最近见到几个 OOM 报告, 应该就是这个导致的
只要有任一以下 flow 变更就会 leak 一份实例.
fetchPlayState.episodeSessionFlow.flatMapLatest { episodeSession -> me.him188.ani.utils.coroutines.flows.combine( episodeSession.infoBundleFlow.distinctUntilChanged().onStart { emit(null) }, episodeSession.infoLoadErrorStateFlow, episodeSession.fetchSelectFlow, combine( danmakuLoader.danmakuLoadingStateFlow, danmakuLoader.fetchResults, settingsRepository.danmakuEnabled.flow, ::DanmakuStatistics, ).distinctUntilChanged(), settingsRepository.danmakuEnabled.flow, settingsRepository.danmakuConfig.flow, )
No response
440a3
The text was updated successfully, but these errors were encountered:
这块代码比较难改 (media selector ui 太烂), 我打算吧 media selector 的 ui 重构了来解决这个问题
Sorry, something went wrong.
Him188
No branches or pull requests
问题描述
me.him188.ani.app.ui.subject.episode.EpisodeViewModel#getPageState 里面创建 MediaSourceResultsPresentation 会传入 backgroundScope.coroutineContext.
而 MediaSourceResultsPresentation 会在这个 context 下 launch job, 导致 presentation 对象 leak (这涉及整个数据源匹配链路上的所有对象). 最近见到几个 OOM 报告, 应该就是这个导致的
只要有任一以下 flow 变更就会 leak 一份实例.
复现步骤
No response
Ani 版本号
440a3
操作系统
No response
应用日志
The text was updated successfully, but these errors were encountered: