serversideup/webext-bridge

High cpu and ram usage

Closed this issue · 3 comments

图片

I don't know what's going on internally, but when I remove all code that references webext-bridge, cpu and ram usage will normal
图片

I use firefox, the following is a profile all threads of process for 5 seconds, hope to help you
https://share.firefox.dev/3oMZ9Z9

There is also the memory leak issue. In just a few minutes, the memory usage has risen to 3GB

Hello @WOSHIZHAZHA120 , We are facing some performance/memory leak issues in my company with our chrome-extension. I have been investigating possible candidates, when I stumbled on your issue.
Why did you close it ? Did you rule out this lead ?

Hello @WOSHIZHAZHA120 , We are facing some performance/memory leak issues in my company with our chrome-extension. I have been investigating possible candidates, when I stumbled on your issue. Why did you close it ? Did you rule out this lead ?

I've been troubleshooting the problem for a long time, and finally realized that it was my fault, I wrapped a Message class, which has a send method, the send method imports sendMessage from webext-bridge/content-script, and the background script imports onMessage from webext-bridge/background, which might be conflicting, and causing me to get high on CPU and RAM very quickly.

There is no problem with removing the conflicting code, just need avoid import two different scope.