RSSHub-Radar
RSSHub-Radar copied to clipboard
扩展启动一段时间后,内存占用飙高
扩展刚启动时占用内存仅 20+ MB,但几天后会发现飙高到 400+ MB,甚至期间并没使用过扩展。
Chrome: 99.0 RSSHub Radar: v1.7.0
Need more debug info:
-
chrome://process-internals/#web-contents
-
-
chrome://extensions/?id=kefjpfngnndepjbopdmoebkipbgkggaa
-> clickbackground.html
-> switch to theConsole
tab
我也遇到了这个问题
![image](https://user-images.githubusercontent.com/12196273/208102321-b74315f8-10cd-40a5-8c23-02fc4f8aaa0b.png)
![image](https://user-images.githubusercontent.com/12196273/208102252-13b1b24c-d58f-4ec5-887d-4360b401dec1.png)
另外,我安装了 workona 标签管理插件并启用了其中的休眠功能(一段时间不使用的标签页会进入休眠),不知道是否与报错有关
我也有使用标签页定时休眠的插件。另外我发现每当打开新标签页(chrome://newtab)就会报错 Failed to construct 'URL': Invalid URL
和 Cannot read properties of undefined (reading 'length')
使用休眠标签导致内存异常的可以试试右键标签改了。
Invalid URL errors are fixed in cf15a0a66a6da8576610f8a0331525e542435727, but I'm not sure if it caused the memory leak
The leak still exists with v1.10.1... Now I’m receiving Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
This problem still exists.
Edge: 111.0.1661.62 x64 RSSHub Radar: 1.10.1
Same issue on version v2.0.6 Chrome: 120.0.6099.109 (x86_64)
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.
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.
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.
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. 653f0db98751f0ae380105c32b8d27a94b1062e0