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

[BUG] 在直播间有严重的内存泄露 #122

Open
NahidaBuer opened this issue Jan 17, 2025 · 6 comments
Open

[BUG] 在直播间有严重的内存泄露 #122

NahidaBuer opened this issue Jan 17, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@NahidaBuer
Copy link

问题描述

简要描述您遇到的 Bug 或错误:

在任意直播间存在严重的内存泄漏。

复现步骤

请提供详细的复现步骤:

  1. 打开网址:任意直播间,例如 https://live.bilibili.com/6
  2. 观察内存占用情况
  3. 发现内存泄漏,泄露速度约 6M/10s

运行环境

  • 操作系统(OS): macOS 15.2 / Windows 11 24H2
  • 浏览器:Chrome
  • 浏览器版本:Stable 131.0.6778.265
  • 插件版本:0.7.0

其他信息

补充任何相关信息或日志:
暂无

@NahidaBuer NahidaBuer added the bug Something isn't working label Jan 17, 2025
@NahidaBuer NahidaBuer changed the title [BUG] [BUG] 在直播间有严重的内存泄露 Jan 17, 2025
@xiaoxuan010

This comment has been minimized.

@hanydd
Copy link
Owner

hanydd commented Jan 18, 2025

@xiaoxuan010 是不是和上次你提到的那个插件类似的情况,那个插件在新版有问题吗?

@xiaoxuan010

This comment has been minimized.

@NahidaBuer
Copy link
Author

抱歉占用时间。

Image

Image

内存泄漏情况是无意间看朋友直播时遇到的,旁边 mac 挂着直播间几分钟崩溃一次才发现不对劲。随后在我自己的同账户 Windows Chrome 上复现了。

上图为昨天遇到内存泄漏时的截图,当时反复比对手头两个设备,在 Windows Chrome 上关闭所有插件、脚本,直至 BilibiliSponsorBlock 才停止内存泄漏。随即在另一台同一用户身份同步的 Mac 上仅关闭 BilibiliSponsorBlock,观察内存占用情况稳定,判断可能是 BilibiliSponsorBlock 的问题。

然后在开启 BilibiliSponsorBlock 的情况下,进入任何直播间都存在相似的内存占用一直增长的情况。

但是我同样的设备今天也复现不了……

@NahidaBuer
Copy link
Author

今天又观察到了跟上次情况相同的内存泄露(挂直播间遇到标签页 OOM)

随即尝试隐私模式复现,仅打开本插件的情况下成功复现。比较诡异的是,内存泄漏问题恰好在我这边某个特定直播间最严重。
如下面两张图所示,可以注意文件名或右上角时间戳,一个直播间泄露了 ~700MB,另一个泄露了 ~100MB.
DevTools 观察 JS 堆内存无增长,内存泄露发生在其他层面。

Image
Image

就在截图时,内存泄露较快的直播间已经崩溃了。
关闭本插件后,标签页内存始终稳定在 ~450MB,没有内存泄露问题。
上述问题均在截图的 Mac (stable 132.0.6834.84) 和另一台 Windows PC (stable 132.0.6834.110) 上复现,相比上次浏览器发生了更新。

Image
Image

可否让插件仅匹配视频播放页面?

@hanydd
Copy link
Owner

hanydd commented Jan 27, 2025

我发了个0.7.2尝试修复一下,看看怎么样吧。改权限需要比较慎重,因为改了以后插件会默认关闭,好像要手动打开才行,尽量不改了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants