-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Riot/Web locks Chrome 80 solid for ~40s with ~12 cores of kernel #12417
Comments
Looks like a DOM leak - i have 127,134 detached div elements hanging around. I took a (1.5GB) heap dump. The unreleased facebook/react#17666 looks like it might be related, so i'm trying on |
The multi-minute pauses were driving me nuts, so I went on a leak mission with help from @t3chguy and @jryans. Conclusions are: we have leaks in:
This looks to be a dup of #10890. This probably deserves a writeup similar to https://blog.discordapp.com/discord-react-memory-leak-565c89763e8 to explain the methodology and for future readers to avoid experiencing the same pain of working out how to drive dev tools to find the leak. My notes are:
stuff which didn't work:
|
@turt2live why is riot/web locking Chrome for a minute every few hours not a fire? |
As far as I know it's only affecting 1 person and not widespread. It doesn't sound like a drop-everything-and-fix-it issue, but definitely one that should be p1 for when the maintainer role is out of fires to put out. It was also missing from the board and presumed to be not a fire if it hasn't been tracked fully. |
This should be affecting anyone with a relatively big account. I suspect it's got worse recently either due to a Chrome upgrade (such that it now takes out the whole browser rather than killing the tab), or possibly with a recent version of React 16, causing retaining a full DOM tree to have a larger footprint. I suspect it's also the root cause of some of the symptoms described at #10890. So yes, i'm afraid that crashing my browser every few hours counts as a drop everything and fix it, which is why I dropped everything and fixed it. The answer to it being missing from the board is to go put it on the board rather than unhelpfully untag it. |
As someone with an updated Chrome and a large account, I can't say I've seen this as frequently as you've described. |
(let the record show that I failed to read key parts of information which do in fact make this a fire rather than arbitrary performance issues) |
thanks. matrix-org/matrix-react-sdk#4111 fixes the two main leaks, but leaves Velociraptor alone. This seems to result in 3x additional DOM trees being leaked, although it's not immediately clear from the snapshot that it's Velociraptor which is retaining them. Empirically commenting out Velociraptor in RR's render method makes them go away. Leaving this open until it's confirmed that 4111 fixes the main problem. |
Worth trying to update velocity? Looks like you guys forked it in 2015 and haven't updated it since. |
hm, i thought we went back to mainline in matrix-org/matrix-react-sdk#2808. i'm only seeing a few trees leaked from velocity atm (whereas previously they were leaking linearly over time), plus the plan as per #10890 (comment) is to remove it entirely. So not sure it's worth trying to patch up velocity further right now. |
well, good news: with velociraptor commented out, i'm fairly reliably sitting with one or two messagecomposers (with the 2nd typically being linked to some promise/debounce/ratelimit which is hanging around, or possibly fiber's backbuffer). bad news: with it enabled it's hovering between 4 and 6 leaked trees. not the end of the world, but annoying. |
So, I've had one instance of Chrome deadlocking since this while running riot.im/develop. On snapshotting afterwards I found 10 leaked DOM trees unfortunately, all with a tree like this: The line of MessageComposer which retains is the ref of: <SendMessageComposer
ref={(c) => this.messageComposerInput = c} ...but I don't think this is necessarily a leak (although I do recall something about refs leaking). I wasn't seeing this at all on a local branch with Velociraptor commented out, so I think it may be related - but tracking it here. I suggest we keep this open (but de-fired) to gather more datapoints on tree leaks. |
just had another; lasted 2 minutes: This time with 9x dom trees leaked (mix of velocity and the retain failure mode from the previous comment), but only 1200 detached divs (as opposed to the 250K odd I've seen in the past). The Chrome task manager claims the tab is using 950MB of RAM total, and 280MB of GPU RAM - which seems relatively high but not crazy. So, I think whatever the problem is still happening (although I am very tempted to suggest we take the time to remove velociraptor, otherwise debugging stuff like this is a nightmare). |
...and again. feels like it's happening about as often as before the mem leak fixes \o/ |
...and again. dmesg has:
...which stopped once it recovered. This sounds like the intel GPU cocking up. |
going to try resetting SMC :| |
What happens if you spend your day in not-Chrome as a test? |
yup, already switched :) |
...and it happened again. without any Riot/Web open. I've switched back to Firefox, although will leave this open a bit longer just in case FF starts melting too. |
also not fixed as far as I'm aware? |
Yes, it's not fixed - I just had it again after absentmindedly opening Riot in Chrome for the first time in a while. (please don't close unfixed bugs...) |
I've since had it a few times on other webapps without Riot being open in Chrome at all - in other words, this is some bad interaction between Chrome, Catalina, and possibly my GPU. Therefore this whole wild goose chase really looks to have nothing to do with Riot. (Meanwhile I've switched to Firefox and/or Riot Nightly when using Riot itself). |
Hello my mac is experiencing same problem. Have you found a fix for that? I'm worried that It may caused by GPU malfunction or overheating. |
I think it would be best for you to file a new issue with more details on what you're seeing, as could be something entirely different, system specific, etc. |
Almost certain it's a V8/macOS issue; running any Chromium/Electrum app causes heavy power consumption and lagging, including Chrome, Chromium, Brave (all Chromium), and VSCode (Electrum). Running macOS 10.15.4 (19E287) on a 2015 MBP. |
* New context for local device verification * Fix up tests * Use PropsWithChildren
Every hour or so I'm getting spectacular deadlocks on my account, which beachballs Chrome 80 on Catalina for 30-40s at a time. JS heap is ~300MB, but it looks like something may be leaking sprites? This began ~1 week ago.
Hitting the box with System Trace in Instruments (given Catalina has broken dtrace...) shows that Chrome is thrashing away doing dispatches which turn into kevents for managing a CoreImage cache?
The text was updated successfully, but these errors were encountered: