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

Browser hangs every few minutes, Brave Sync process consuming 100% CPU #6098

Closed
latonv opened this issue Sep 20, 2019 · 52 comments
Closed

Browser hangs every few minutes, Brave Sync process consuming 100% CPU #6098

latonv opened this issue Sep 20, 2019 · 52 comments
Assignees
Labels
bug closed/not-actionable feature/sync perf priority/P2 A bad problem. We might uplift this to the next planned release.

Comments

@latonv
Copy link

latonv commented Sep 20, 2019

Description

Every 4-5 minutes the browser goes completely unresponsive for ~20 seconds. Having the Task Manager open when it happens reveals that the Brave Sync extension is using 100% CPU during this time. Brave Sync memory footprint also gets rather large (>300MB) and seemingly grows indefinitely over long periods of time. Brave Sync is constantly consuming network bandwidth upwards of 200KB/s.

What makes this particularly odd is that I'm not even in a sync chain. There's no reason why Brave Sync should be doing much of anything at all.

Steps to Reproduce

  1. Fresh install of Brave Dev.
  2. Wait a few minutes for the hang to begin. Or browse a bit, doesn't matter. Seems to be independent of any user activity.

Actual result:

Brave goes unresponsive and consumes all available CPU cycles for 10-20 seconds.

Expected result:

Browser remains responsive and usable.

Reproduces how often:

On my system, this reproduces itself like clockwork every few minutes. I couldn't find any issues describing quite the same problem, so I suspect this one is going to be hard to reproduce elsewhere. Interestingly, my other computer is on a sync chain and doesn't suffer from these hangs.

Brave version (brave://version info)

Brave | 0.71.75 Chromium: 77.0.3865.75 (Official Build) dev (64-bit)
Revision | 201e747d032611c5f2785cae06e894cf85be7f8a-refs/branch-heads/3865@{#776}
OS | Windows 10 OS Version 1809 (Build 17763.737)

Version/Channel Information:

I'm a bit strapped for time right now and can't run a proper test on other channels. Will update tomorrow if I get a chance.

  • Can you reproduce this issue with the current release? Haven't tried
  • Can you reproduce this issue with the beta channel? Haven't tried
  • Can you reproduce this issue with the dev channel? Yes
  • Can you reproduce this issue with the nightly channel? Haven't tried

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? No
  • Does the issue resolve itself when disabling Brave Rewards? No
  • Is the issue reproducible on the latest version of Chrome? No

Miscellaneous Information:

@Martina-Neumayer
Copy link

Martina-Neumayer commented Sep 20, 2019

Well.. I am also affected by this issue.

The browser freezes from time to time for a few seconds (from 5 to even 20). This happened since the penultimate update from the beta channel. The latest one does not fix the problem.

The issue persists even the total, clean (removed configs, profiles etc.) installation and also an fully clean installation on a new installed system.

But.. If I downgrade Brave to v0.70.97 or v0.70.96 all works fine and no freezing occurs.

Edit:
Todays update to the 0.70.99 Chromium: 77.0.3865.90 64bit version from AUR make this issue even worse. Freezes and hangs appears more often than before. Sometimes also sequentially.. one by one.

The one difference from the issue mentioned above is that the my synchro is turned off. I don't use synchronisation feature at all.

Edit2:
Those browser hangs can now also freeze entire system. Cursor does not move, SMPlayer stops playing the movie etc.

System: EndeavourOS (fully up to date) Arch-based distro.
Browser: Brave beta version 0.70.98 Chromium: 77.0.3865.75 64bit
Machine specs: on the attached screenshot below.

2019-09-20_14-12

@wildcard-f8
Copy link

I've been experiencing this too. I'm on Ubuntu 18.04. Started happening a couple of updates ago.

@swiesend
Copy link

swiesend commented Sep 21, 2019

I am experiencing something very similar. But I think it is one of the brave --type=renderer processes or the brave --type=gpu-process. The problem occurs, when entering the brave window after being in others for a while or after beeing in brave for a time and trying to switch fast from brave to another window and back again. Then my whole Desktop freezes and not only the brave rendering.

It happens often and for some seconds, but until now I can't figure out the trigger conditions (which is mainly entering the brave window, but sometime it freezes when not beeing in brave). Sound is fine and running while a freeze occurs.

@Martina-Neumayer
Copy link

Yes.. Even simple switching the opened tabs in browser can trigger this issue. Especially on pages like Facebook, MeWe, or where are for example build in java/js pics galeries (something where is horizontal iframe based scrolling).

@cwchien
Copy link

cwchien commented Sep 26, 2019

I use Brave release on Ubuntu 19.04, and this problem occurred since 0.68.138.
(the latest 0.68.141 still has this problem)
I downgraded to 0.68.132 and everything is fine.

@wildcard-f8 you can try sudo apt-get install brave-browser=0.68.132 then sudo apt-mark hold brave-browser to prevent it from upgrading.

@wildcard-f8
Copy link

wildcard-f8 commented Sep 26, 2019 via email

@Martina-Neumayer
Copy link

Update:
I've upgraded yesterday my Brave to the AUR's 0.70.101-1 version (0.70.101 Chromium: 77.0.3865.90) from here: https://aur.archlinux.org/packages/brave-beta-bin
And there are no more hangs or freezings.
But.. the browser sometimes "eats" a way too much of the cpu power.
Seems like instead of those freezings is now some excessive usage of the cpu resources.
Apart from that, nothing more bad is happening.

@gregersn
Copy link

gregersn commented Oct 1, 2019

This is also experienced on Mac, with the newest release.

@Martina-Neumayer
Copy link

I updated my Brave to the latest 0.70.104-1 version from AUR (0.70.104 Chromium: 77.0.3865.90 x64) and the issue is still there no matter if the sync is on or off.

@boromil
Copy link

boromil commented Oct 2, 2019

Same here, Brave 0.71.84 Chromium: 77.0.3865.90, Arch Linux

@rebron rebron added the priority/P2 A bad problem. We might uplift this to the next planned release. label Oct 4, 2019
@darkdh darkdh added the 1.0 label Oct 8, 2019
@Martina-Neumayer
Copy link

Another browser update 0.70.113-1 (0.70.113 Chromium: 77.0.3865.90) and nothing changed. Issue is there. And looks like that it has something to do with the Nvidia drivers (nvidia-dkms package).
Every time those gpu drivers are updated, then the Brave issue comes again.
Even simple YouTube movie watching in low res., can overheat the machine in a few minutes.

@br-fedaykin
Copy link

br-fedaykin commented Oct 11, 2019

And looks like that it has something to do with the Nvidia drivers

That makes sense. I am experiencing that problem too.

At a first moment I suspected about the sync feature because it is failing to work with bookmarks removal (it is always putting back what I delete in local browser), but after reading this thread I'm thinking the problem could involve GPU, because my PC at work has a Nvidia card and the process freezing time is much worse than at home, where I have a PC with a Radeon RX 580 (and different components, notably a faster processor).

The Brave mobile app also crashes randomly and that leads me to suspect again about syncing problems, so I'm still in doubt about what could be the cause.

Both PCs have Brave version 0.69.135 Chromium: 77.0.3865.120 x64
Both have Windows 10 version 1903 - Compilation 18362.418 (work) and 18362.10022 (home)

Work Videocard
GeForce GTX 550 Ti 1GB
Driver version: 391.35

Home Videocard
Radeon RX 580 8GB
Driver version Versão do Driver: 19.30.25.10-191004a-347338E

@latonv
Copy link
Author

latonv commented Oct 12, 2019

Sounds plausible. I'm also running it on an Nvidia card with the latest drivers (GeForce RTX 2060).

@Martina-Neumayer
Copy link

Well.. seems so.. I am using Prime under my Arch and if I switch to intel gpu then is allright. No browser issues, hangs, overheatings etc. But.. if the Nvidia gpu is on, then this whole "circus" begins and even simple browsing on some fb page can boil my knees very fast. Besides.. the jumbo-jet-engine-like noise from the laptop both coolers is also not a most pleasant ;)

@srirambv
Copy link
Contributor

srirambv commented Oct 13, 2019

But.. if the Nvidia gpu is on, then this whole "circus" begins

@Martina-Neumayer I don't see an issue with Nvidia legacy drivers on Ubuntu. Are you using the non-free drivers from Nvidia?

@Martina-Neumayer
Copy link

I don't use Ubuntu so there are no free drivers here. My system is Arch based EndeavourOS and it uses normal drivers from the standard Arch "extra" repository. To be exact it is a nvidia-dkms 435.21-11 package now. The mentioned prime is arch-prime-git 0.9.4.r1.g2396832-1 from AUR.

@AlexeyBarabash
Copy link
Contributor

AlexeyBarabash commented Oct 15, 2019

Using Ubuntu 16.
I had seen UI hangs with browser and filed an issue #3954 long time ago. Finally I found that my system hangs even if I launch several instances of Chrome with lots of opened tab, even without Brave running. Fixed that by switching to recommended Nvidia drivers for Ubuntu from the software updater tool.
But I am not sure about reasons of current discussed issue (#6098).

@bridiver
Copy link
Contributor

bridiver commented Oct 16, 2019

I think we have several different issues that need to be split up:

  1. Sync extension is running when sync is disabled
  2. Sync extension process uses high CPU
  3. Sync is using a lot of network bandwidth
  4. Sync is causing the browser to hang - high cpu usage on browser process

Does that look correct to everyone? 2 and 4 seem like they are connected, but I think we should file separately and merge if we decide it's the same issue. My guess is that sync is going through some kind of polling loop because sync isn't actually enabled which may also result in the high network bandwidth. Just disabling the extension when sync is enabled may fix all 4, but we should make sure there isn't also an issue when sync is enabled.

@agentofuser
Copy link

agentofuser commented Oct 16, 2019

@bridiver in my case all are correct, though in the case of 3) it's not that it's using a lot of bandwidth but that it is constantly using bandwidth (~50 KB/s here) while it shouldn't be doing anything.

I would add that there is also a "Brave" task that is high CPU, separate from the "Extension: Brave Sync" task which also is high CPU.

@Martina-Neumayer
Copy link

For me also does not work.

@Nuc1eoN
Copy link

Nuc1eoN commented Jan 12, 2020

I have a similar issue described in my bugreport #6905

Leaving the sync chain and restarting my browser appears to have fixed the freezing issue for me. Can you guys try to reproduce if it also fixes your issue?

@msundin
Copy link

msundin commented Jan 18, 2020

I also have this issue where Brave freezes periodically. I'm 100% sure that it's an issue with sync (I have thousands of bookmarks) since every time I leave the sync chain on a system, the problem goes away completely. When I join the sync chain again, the problem reappears. On all systems.

I've confirmed this sync related problem in Brave on all these systems:

  • Arch Linux
  • Windows
  • MacOS

I also have the problem on my Android phone but in another way it seems: Brave freezes every time i add a new bookmark if sync is enabled.

To sum up: 100% sync related for me.

@Hispeeday
Copy link

  1. I have the same problem on Linux (currently Fedora 31) and a fresh Windows 10 install (1909).
  2. The problem starts after joining my Sync chain.. and completely subsides when I leave said Sync chain.
  3. In Windows Performance Analyzer there is only lots of CPU power used by brave.exe (chrome.dll, etc.); no I/O happens during the lags (ie. SAN or network traffic).
  4. The browser task manager, right after one of the freezing episodes, shows (for a splitsecond) "Browser" at near 100% CPU usage with 3x the memory usage of what it was before the freezing episodes.. and what it was after the freezing episodes. This could indicate calculations involving big structures in memory.. like eg. my 1000+ bookmarks, being diff'd to find out what has to be synced over to the Sync chain.

I hope this can help with the debugging.

@darkdh
Copy link
Member

darkdh commented Jan 21, 2020

@msundin @Hispeeday did you try creating a new sync chain instead of joining existing one?
(This won't make your local bookmarks disappeared) Just want to make sure it is not caused by corrupted sync chain.

@Nuc1eoN
Copy link

Nuc1eoN commented Jan 21, 2020

@darkdh And how would we do that? I press "Create new sync chain" and it wants to to enter 24 words on another computer. I dont see a way to start a new chain standalone.

@darkdh
Copy link
Member

darkdh commented Jan 21, 2020

@Nuc1eoN all devices leave the current sync chain and you choose one device to create sync chain and others join it.

@msundin
Copy link

msundin commented Jan 27, 2020

@msundin @Hispeeday did you try creating a new sync chain instead of joining existing one?
(This won't make your local bookmarks disappeared) Just want to make sure it is not caused by corrupted sync chain.

@darkdh This issue has been present since I first created a new sync chain a few months ago. So yes, I started with a fresh sync chain and the problem immediately appeared and has been there since then.

@Martina-Neumayer
Copy link

Issue stil remains, even if the sync is not used at all.
Every new opened tab can freeze Brave for few good seconds. Even the internal ones - settings tab, addons tab, etc.
Sometimes such new tab won't load entirely. Loading indicator (icon on the tab) goes on (rotates) forever and the browser in this moment freezes.
Refreshing the tab helps for a while, but next newly opened does the thing again.

Browser: v 1.5.96 Chromium: 80.0.3987.116 (Official Build) unknown (64-bit)
System: Arch.

@rebron
Copy link
Collaborator

rebron commented Apr 14, 2020

We've updated Brave to 1.7.92 today. When you get a chance can you update to this latest version via brave://settings/help and see if you're still encountering this issue.

@Hispeeday
Copy link

I tried three test cases:

  1. Current stable brave windows, with a new set of bookmarks I had to create because sync wouldn't work => Removed it from its own sync chain. Added it to the old non-working sync chain.
    Result:
    After entering the sync code and pressing the bottom right button, it simply waits for 5-10 seconds while showing the waiting mouse cursor.. then simply reinstates the button as if it hadn't been pressed at all. You can repeat this as often as you wish.

When you exit the "add to sync chain" dialog and reload the brave://sync page, you are suddenly shown as added to the sync chain you choose.

BUT: The sync never manages to reintegrate the local bookmarks into the sync chain bookmarks, or vice versa.

  1. New brave browser Windows, 1.7.92: Tried adding it to the old, non-working sync chain.
    Result: Same as on situation 1, but the bookmarks from the old sync chain never download to the new browser.

  2. New brave browser Windows, 1.7.92: Exported bookmarks from old browser and imported them into the new browser. Created a new completely new sync chain. Removed the old non-working browser from the old sync chain, and upgraded the software to 1.7.92 (Linux Fedora in this case). Then tried adding the browser with its already existing set of bookmarks to the NEW sync chain.
    Result: Same as 1, and also the sync never happens.

@Nuc1eoN
Copy link

Nuc1eoN commented Apr 14, 2020

Sometimes it took a long time for my sync chain to fully sync. But finally it always did.

I think the user should have a progress bar, that indicates the progress/status somehow.

@Naheel-Azawy
Copy link

Same here... Arch Linux

@Nuc1eoN
Copy link

Nuc1eoN commented May 1, 2020

@Naheel-Azawy can't find the comment but @bsclifton probably has some brave launch parameters for you to test.

@Godridge
Copy link

dogpiling. still happens frequently arch linux

@ravenclaw900
Copy link

I have the same problem as well, on macOS. Brave freezes and I have to force quit.

@Martina-Neumayer
Copy link

Updated yesterday my Brave from the 1.10.85-1 to 1.11.61 version and this was a big mistake.
It literally kills my machine by overheating the cpu/gpu.
Just a few minutes of browsing for example facebook, youtube, or any other random page and the browser boils the laptop away, The fans howl like crazy.
Don't know what the heck is going on, but the only "fix" for me is a downgrade back to the 1.10.x.x version. The 1.11.x is totally unusable.

@bsclifton
Copy link
Member

@Martina-Neumayer thanks for letting us know - I'm curious if you're able to try 1.11.61 again and this time open the Task Manager when CPU hogging happens. It's in the hamburger menu (three lines in the top right) under More tools => Task manager

When open, it'll look something like this- you can sort by CPU usage
image

@Martina-Neumayer
Copy link

Martina-Neumayer commented Jun 15, 2020

@bsclifton The problem is that when this issue occurs, the entire laptop freezes in a matter of few seconds. And all I can do is to press and hold the power button to turn it off. There is not enough time between the problem occurring and the system/machine freezing.
Sorry.. I forgot to mention about this in my previous comment.

BTW.. Seems that another old problem is back again in the v.1.11 release.
This one to be exact..
#270

Update:
Okay.. I updated Brave today to v.1.11.74 and seems that the overheating problem is gone. The browser does not freeze the entire machine anymore.
But this issue with the wrong DPI and UI scaling is still there.

@bsclifton
Copy link
Member

Closing issue as we'll be having Sync v2 in 1.12 and it doesn't make sense to fix v1. At this time, the recommendation would be to turn off Sync v1 via brave://flags/#brave-sync

For folks experiencing high CPU not related to sync, let's open a new issue with more details 😄 The task manager bit above is super important for diagnosing what is causing CPU usage. Other issues (DPI / UI scaling) should have their own issues with information as that is a different problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug closed/not-actionable feature/sync perf priority/P2 A bad problem. We might uplift this to the next planned release.
Projects
Status: Completed
Development

No branches or pull requests