Closed jchittoda closed 5 years ago
This may be related to a memory leak just discovered in provider-engine that was recently shipped. We are currently working on that, and hopefully in our next version you'll see this improve.
@jchittoda are you still experiencing this issue?
@bdresser Yes, recently I left Kovan network running in Chrome for some time and it started taking more memory. Ultimately I had to kill the MetaMask from Chrome.
Soon we are replacing our entire provider stack, so it's possible that major change fixes this issue (or replaces it with a different one), so I think we should wait for this PR to be deployed before trying to address this:
wow thats a lot of memory. thanks for the report!
also TIL chrome task manager
!
@danfinlay I'm exhibiting high memory use, as well. Should I submit a separate ticket since I'm on Win10 1803?
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
This issue now has a funding of 0.4 ETH (185.14 USD @ $462.85/ETH) attached to it.
@lastmjs Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
Hi @lastmjs how is this going?
I'll be starting to look into this today
On Mon, Jul 30, 2018, 11:28 AM Vivek Singh notifications@github.com wrote:
Hi @lastmjs https://github.com/lastmjs how is this going?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MetaMask/metamask-extension/issues/4074#issuecomment-408944657, or mute the thread https://github.com/notifications/unsubscribe-auth/AGrSj_CuqciUWGswzdum3u1QQj3SVnixks5uL0JYgaJpZM4TiwKy .
I'm sorry, assessing my situation yesterday and today, I don't realistically have the bandwidth right now...good luck
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
Work has been started.
These users each claimed they can complete the work by 11 months, 3 weeks from now. Please review their action plans below:
pranay01 has started work.
What steps will you take to complete this task?
Example: I'd start by implementing Netflify, then I'd make mockups for the /blog page and individual post pages and proceed with building them after getting some feedback from the team. I will start work on this right away and have it ready by the end of the weekend.djlksjdasjd;lkjasldk;jsa j;adsdskjas dd;ajsdkjas;djakl;sd sdjsla;djs
Learn more on the Gitcoin Issue Details page.
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
Work has been started.
These users each claimed they can complete the work by 4 months, 2 weeks from now. Please review their action plans below:
1) connorchristie has started work.
I have started looking into the possible causes and found some initial concerning messages about "MaxListenersExceededWarning" which I followed and lead me to the publicConfigStore event emitter. Where I plan to determine if this is the actual root cause
Learn more on the Gitcoin Issue Details page.
After looking more in-depth into the memory usage of the extension, I see a new event listener is added for every tab opened and multiplexed into the publicConfigStore event emitter.
Below is a memory snapshot of the extension after opening many tabs and closing them right away where we see publicConfigStore._events
taking up the majority of the heap. When querying the number of items in the event handler array, there were roughly 130 where the limit it initially set to 11.
The method setupUntrustedCommunication
gets called whenever a page is created and metamask connects to it which ends up calling the below method which adds a new event handler to the config event emitter through obs-store
This is my initial analysis however it looks promising due to the fact the added event handlers are never removed and they add up over time after numerous tab opens and closes.
Another memory leak was found in the main controller's setupControllerConnection
where it would subscribe to the on('update')
event emitter. Upon opening the extension window, this would add a new handler but not remove it when the window was closed.
fyi @kumavis @danfinlay
@ConnorChristie Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
Replying for the sake of Gitcoin. - I have been able to test my changes however they require a change to ‘obs-store’ which I have a PR out for before I can submit a pull request.
It seems the major memory leaks have been fixed in previous PRs but there are still some minor ones out there which I have found and fixed
@ConnorChristie Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
@bdresser this one looks good for payout, yes? Just FYI -- even though @ConnorChristie hasn't submitted work yet, you can payout using the 'Advanced Payout' feature 👍
⚡️ A tip worth 0.80000 ETH (145.62 USD @ $182.03/ETH) has been granted to @ConnorChristie for this issue from @bdresser. ⚡️
Nice work @ConnorChristie! Your tip has automatically been deposited in the ETH address we have on file.
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
Work for 0.8 ETH (145.62 USD @ $182.03/ETH) has been submitted by:
@bdresser please take a look at the submitted work:
Thanks @ConnorChristie! Paid.
Leaving this issue open. We'll follow up a couple weeks after next release to check that reports via github & support have subsided.
In the meantime, if others find memory leaks in production, let us know!
Leaving this issue open. We'll follow up a couple weeks after next release
@bdresser , 3months past, should be fine to close I guess.
What a great bounty this was! I am chiming in here simply to note that the bounty is still open on Gitcoin and as it was marked closed here by @bdresser 29 days ago, I will ping a @gitcoinbot team member (@ryan-shea) so the Gitcoin page is updated. Cheers!
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
This Bounty has been completed.
Additional Tips for this Bounty:
Bounty: MetaMask has received multiple reports of the extension running high CPU usage. This bounty is to identify the root cause of the issue and write a patch.
MetaMask showed high memory and CPU usage. My laptop become unresponsive. When I killed MetaMask from Google Chrome's Task Manger window, then my laptop become responsive. I was on Kovan network, could this be an issue, because blocktime for Kovan (PoA) is 5 seconds.
Actual Behavior
I kept my laptop running overnight, and when wakeup in morning, my laptop fan was running in full throttle, when I tried to find, which process is taking that much resources. I found Chrome and when opened TaskManager in Chrome, I found MetaMask is the culprit.
Expected Behavior
It should not take that much of memory. It should clean the memory regularly.
Browser Used
Google Chrome 65.0.3325.181 (Official Build) (64-bit)
Operating System Used
MacOS High Sierra 10.13.4
Here is the screen shot of the Chrome's Task Manager.