Brave-browser: Browser hangs every few minutes, Brave Sync process consuming 100% CPU

Created on 20 Sep 2019  Â·  52Comments  Â·  Source: brave/brave-browser

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:

bug closenot-actionable featursync perf prioritP2

Most helpful comment

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.

All 52 comments

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

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

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.

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).

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.

thanks

On Thu, 26 Sep 2019 at 9:21 AM Cheng-Wei Chien notifications@github.com
wrote:

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 https://github.com/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.

—
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/brave/brave-browser/issues/6098?email_source=notifications&email_token=AMLELDSKSXCUDXV2RWNU6ELQLQFAVA5CNFSM4IYTT5TKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7T5QEQ#issuecomment-535287826,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMLELDSXWW666AFURI26ZULQLQFAVANCNFSM4IYTT5TA
.

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.

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

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.

Same here, Brave 0.71.84 Chromium: 77.0.3865.90, Arch Linux

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.

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

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

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 ;)

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?

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.

Using Ubuntu 16.
I had seen UI hangs with browser and filed an issue https://github.com/brave/brave-browser/issues/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).

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.

@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.

@agentofuser the Brave task is the main browser process and that high cpu usage is likely what is happening with 4. I updated to clarify

For me..

  1. yes
  2. no
  3. no
  4. no or 50/50 no

After switched to Intel gpu with nvidia-prime, this problem never happens.

  • Brave 1.0.1 Chromium: 78.0.3904.108
  • Ubuntu 19.10

Problem is less pronounced than before but still persists. Now and then, the browser becomes unresponsive for a few seconds - for no apparent reason.

Arch Linux, Brave 1.0.1, Nvidia NVS 5200M

Same here, now and then it freezes for a few seconds

Arch Linux
Brave 1.0.1
NO gpu

On Brave beta v.1.2.18 Chromium: 78.0.3904.108 from AUR looks like the "hangs" problem is gone.
EndeavourOS (Arch based)
Nvidia: nvidia-dkms 440.36-4
Kernel: 5.4.1.arch1-1
Prime: arch-prime-git 0.9.4.r2.ge754390-1

On Version 1.1.20 Chromium: 79.0.3945.74 (Official Build) (64-bit) I can reliably replicate the browser hanging and consuming 100% of CPU by switching to a specific tab I had open. I've had this occurring intermittently for about a week

I just upgraded to Brave Version 1.1.23 Chromium: 79.0.3945.88 (Official Build) unknown (64-bit) on Manjaro 18.1.5 and kernel 5.4.6-2-MANJARO, and this issue presented. I initially thought it was just an issue with scrolling, but then realized it "froze" intermittently at any processor intensive action.

Is there any solution?

@TheRoarkster I switched to Intel gpu with nvidia-prime, then this problem never happens.
Version: 1.1.23
Chromium: 79.0.3945.88 (Official Build)
Ubuntu 19.10 64bit

The problem is back there.
Switching to the Intel gpu is not a way for me, because I am working almost non-stop with Nvidia gpu requiring apps.

At this Brave version there is one more symptom.. If you try to download and then save some picture and the file has no extension added, then the entire browser will hang for a 30-60 seconds on the filechooser screen. You can't switch the tabs opened, you can not close this window, you can do nothing at all. You need to wait until the browser "un-hang" himself.
If you're working on something in some other app in this moment, all your work is a trash now. It will be corrupted by this Brave hang.

This "no extension" save problem reminds me of an old issue that occurred several years ago in Chromium. I can't remember what was the exact cause of it.. the topic on bugtracker is no longer accessible.. but it was something with the browser sandboxing.

Brave v.1.3.79 Chromium: 79.0.3945.88 64bit from AUR.
Arch with the kernel: 5.4.6-arch3-1 x86_64
Nvidia driver: 440.44
Machine: Lenovo Legion Y530-15ICH-1060

@cwchien The issue with Brave hanging exists while I'm using Intel. My "solution" is to downgrade to the prior version of Brave.

Curious if folks here could try DISABLING the following flag:
brave://flags/#enable-oop-rasterization

For some people experiencing hangs/crashes, I suspect this will fix the problem. I'm working on a revert of that flag via https://github.com/brave/brave-core/pull/4318 (which we'll be able to release in one of the next updates)

@bsclifton I just tried that, didn't fix it for me. Thank you for the ongoing investigation.

For me also does not work.

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?

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.

  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.

@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 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.

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

@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.

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.

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.

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.

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.

Same here... Arch Linux

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

dogpiling. still happens frequently arch linux

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

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.

@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

@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..
https://github.com/brave/brave-browser/issues/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.

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

Was this page helpful?
0 / 5 - 0 ratings