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

扩展启动一段时间后,内存占用飙高 #694

Open
twio142 opened this issue Apr 25, 2022 · 12 comments
Open

扩展启动一段时间后,内存占用飙高 #694

twio142 opened this issue Apr 25, 2022 · 12 comments

Comments

@twio142
Copy link

twio142 commented Apr 25, 2022

扩展刚启动时占用内存仅 20+ MB,但几天后会发现飙高到 400+ MB,甚至期间并没使用过扩展。

image

Chrome: 99.0
RSSHub Radar: v1.7.0

@Rongronggg9
Copy link
Contributor

Need more debug info:

  • chrome://process-internals/#web-contents
  • chrome://extensions/?id=kefjpfngnndepjbopdmoebkipbgkggaa -> click background.html -> switch to the Console tab

@aur3l14no
Copy link

aur3l14no commented Dec 16, 2022

我也遇到了这个问题

image

image

另外,我安装了 workona 标签管理插件并启用了其中的休眠功能(一段时间不使用的标签页会进入休眠),不知道是否与报错有关

@twio142
Copy link
Author

twio142 commented Dec 16, 2022

image

我也有使用标签页定时休眠的插件。另外我发现每当打开新标签页(chrome://newtab)就会报错 Failed to construct 'URL': Invalid URLCannot read properties of undefined (reading 'length')

@JJcdomat
Copy link

JJcdomat commented Dec 17, 2022

使用休眠标签导致内存异常的可以试试右键标签改了。
image

@DIYgod
Copy link
Owner

DIYgod commented Jan 15, 2023

Invalid URL errors are fixed in cf15a0a, but I'm not sure if it caused the memory leak

@twio142
Copy link
Author

twio142 commented Jan 18, 2023

The leak still exists with v1.10.1... Now I’m receiving Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.

@Chaoses-Ib
Copy link

image

This problem still exists.

Edge: 111.0.1661.62 x64
RSSHub Radar: 1.10.1

@lesywix
Copy link

lesywix commented Dec 27, 2023

Same issue on version v2.0.6
Chrome: 120.0.6099.109 (x86_64)

@DIYgod
Copy link
Owner

DIYgod commented Dec 28, 2023

I speculate that the memory leak in the v2 version is caused by console.debug. I have removed all console.x at here. Please observe if v2.0.7 still has any memory issues.

@DIYgod
Copy link
Owner

DIYgod commented Dec 30, 2023

In version 2.0.7, the memory consumption is still high, but the background service worker and offscreen.html memory usage seems to be normal. I'm unsure about the exact cause of the problem.

@aur3l14no
Copy link

Sharing a workaround: I remove the permission "access to all pages" so that the extension is only activated when I click on it. Seems to be smoother now.

@DIYgod
Copy link
Owner

DIYgod commented Feb 23, 2024

I further debugged and found that the memory leak may be caused by DOMParser. Then I found a stackoverflow post confirming my guess, so I removed DOMParser in this commit, hoping this will solve the problem. 653f0db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants