-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Signal Desktop GUI hogs CPU on macOS #3542
Comments
What happens after that first couple minutes of runtime? It's reasonable to expect an application to do some work up front to make things faster going forward, or when processing a lot of data, but it would be an issue if it were a long-term trend. Speaking of processing a large amount of data, do you have a lot of contacts? The more contacts you have, the more data Desktop needs to decrypt right after you link. |
I'm sorry if I gave you the impression this is a "startup" kind of bug, it's absolutely not. I guess you assume that from the screenshot: for the purposes of the screenshot I had just restarted Signal, but it happens regardless of runtime. And it's not background activity, the correlation with GUI changes is clear: it notably happens on new received messages. Indeed, the first time I experienced that bug I was watching a HD YT video when I received a message: I heard the signal notification sound (can't remember if that was on my phone or on the Mac so don't assume the notification sound went immediately through on the latter) and then almost everything came to a complete halt on my machine, before resuming moments later after the notification and new message had been displayed. As for contacts, I have exactly 13 at this time. |
At this point we're going to need a whole lot of information about your computer. Machine specs (hardware visual acceleration details too), its performance and CPU usage in Google Chrome, etc. We can't repro what you describe locally, so we're relying completely on data you provide. |
Specs of the machine: https://everymac.com/systems/apple/macbook_pro/specs/macbook-pro-core-i7-2.5-15-dual-graphics-mid-2015-retina-display-specs.html As for Google Chrome, being privacy-conscious I never use it. I'm ok to perform tests but could you elaborate on what I need to test for please? FWIW 1.27.1 still exposes the problem. I've also updated to 10.14.6 18G95 |
@f00b4r0 Hit any somewhat complicated site in Chrome, and look at the CPU usage. You can also tell us about your usage of Signal Desktop. Do you have a lot of disappearing messages visible at any given time in the app? What about if you open a conversation with no messages in it, does that change the CPU usage? We're looking for anything that might contribute. |
So I checked out apple.com and theregister.co.uk frontpages in a freshly started Chrome (run from disk image) vs Safari. Chrome's CPU is very significantly higher than that of Safari, typically 3-4x higher and the websites feel a lot less responsive. CPU usage was not as bad as what I saw scrolling the debug log in Signal. Then it dawned on me to browse and rapidly scroll my uploaded debug log from Chrome and bam, exactly the same madness: ~200% CPU load in top... By comparison, browsing/scrolling (same pace) the same webpage from Safari uses 30-35% CPU total (Safari ~10% + WindowServer ~25% ) As for my usage of Signal, it's extremely sparse. I occasionally exchange plain text with one contact at a time and no special features (disappearing message), save for the occasional smiley... |
The only thing I can think of is that your graphics hardware acceleration is having major problems. Try launching Signal Desktop without hardware acceleration. Open up Terminal, then run this:
|
If I do that and rapidly scroll the debug log I see one Signal Helper thread at ~75%, another at ~15% and WindowServer at ~15%, which is clearly better than the previous case. |
@f00b4r0 have you noticed any connection between the hangs and the contact typing indicator? |
@lnicola Not that I recall. I eventually stopped using Signal Desktop. |
I am seeing this as well -- on my beefier machine it is typically two SignalHelper processes each using 20% of CPU plus WindowServer at 30%; all go away when I stop signal. I can try to get reproduction scenarios or logs if someone tells me what is needed. For me the issue typically happens just before the UI receiving a message in the few minutes after waking from sleep -- in fact I know a message will arrive shortly when I hear my laptop fans spin up. Here's a typical snapshot of my top three processes during the CPU load incident, via There's nothing obviously weird in the debug log. I've uploaded it anyway in case it helps. https://debuglogs.org/84dd96ce52bcd1b47429ea6da928d3273bdcfd5140830240e204bd1642fd65dd Hope this helps! Signal being heavier than my web browser is just strange. |
Out of curiosity I tried a recent (v1.34.1) Signal Desktop client on my Mac (same model as before: I like it ;). As soon as a contact starts typing and the waving three dots appear in the chat window, the machine is completely stuck. Absolutely no other window will update (rainbow disc everywhere), it's totally insane. sigh |
@f00b4r0 One thing that Mac users can do to help us out is an Activity Monitor 'sample.' Double-click the process in Activity monitor, and you should see a 'Sample' button in the bottom-left. This is especially useful if it's while that 'rainbow disc' is showing. |
I tried sampling during "typing indicator". Sampling while rainbow disc seems impossible as nothing is responsive during that time and the Activity Monitor sampling period is very short (3s). As far as I can tell the GPU helper is the one hogging the CPU. HTH Échantillon de Signal.txt |
@f00b4r0 Thanks for taking those samples. However, they aren't very useful without a pretty detailed account of what was happening in the app at that time. You mention a typing indicator - were you in a 1:1 chat with someone, with the typing indicator showing? |
@scottnonnenberg-signal well, I merely did what you asked: you asked for samples, I provided. You didn't ask for context 😛 Re your question: Signal app started, 1:1 chat, typing indicator (from remote party nice enough to bear with my testing and provide long type sequences) showing, yes. |
@f00b4r0 Thanks. What can you say about your computer? Model? Year? |
See #3542 (comment) |
I noticed the same thing (Skylake iGPU laptop, Linux). When the typing animation is running, the text I'm typing does not (did not?) appear. That's with 1:1 chats. The renderer process is using a lot of CPU while the animation is showing. |
Same here. I see elevated CPU usage in a 1:1 chat when my peer is typing (typing indicator showing). On a MacBook Pro, OS X 10.15.6. |
I see 100% CPU on Mac OS X 10.14.6 (Mac Pro Late 2013, 64GB RAM) when Signal (upgrading to 1.36.2 and earlier) is asking for admin creds to install a new helper app. If that happens when I'm AFK, I come back to noticeably louder fans from the Mac Pro. The rest of the time, it's generally idle -- ~0.3-0.5% CPU (always, polling?) for the renderer, 0.0-1.0% for the main process. Clicking on a different contact or group on the left to switch conversations will spike the Signal renderer to ~50% CPU for a few seconds. Haven't checked while having a conversation with someone. |
@jlfranklin Why would that helper app pop up while you're AFK? It should only pop up after you've chosen to restart signal. |
Not sure if this is the same issue, but here's a sample just before Signal Helper (GPU) forced my (otherwise totally idle) laptop into thermal throttling: While this was happening -- and it stopped as soon as I killed Signal Helper -- the Window Server process was also running at a surprisingly high CPU. So I snagged a sample of it as well if it helps. Again, not sure if this is the same issue or not. |
@scottnonnenberg-signal to answer your question, so far I have not noticed any patterns in when this happens. I wish I had something more helpful to report. My first thought was maybe it was a result of a background upgrade helper program, but the high CPU issue didn't seem to correspond to when updates were installed for Signal. Also it didn't seem to happen that often, maybe once a week. My old laptop was an intel macbook pro which was known for having notoriously bad thermals. So high CPU meant loud fans that were difficult to ignore. It's much harder to notice on my new laptop so I'm really not sure if it's still happening or not since I upgraded laptops. On my old laptop, I would experience this roughly once a week or so:
Here are my old laptop's specs:
Since I don't have any idea which behaviors/use cases might correspond with the issue, here's just a short list of things that describe how I use my computer in case it helps:
|
This is still happening. I have clear system on MacBook Pro 2018 and Signal 5.25.1. But I can reproduce it evert time. It happens when I put system to sleep with Signal running. When I wake up my Mac Signal Helper GPU process is running 100% Cpu and I cannot shutdown Signal. I have to kill it and start again. |
We'll take another look. |
Could this be related? https://developer.apple.com/forums/thread/681135 @chrisdavidmiles 's comment here could be pointing to the underlying issue:
I see the same issue as well. It also affects Slack; however, in Slack, you can just reload a bunch of times (Cmd-R/Cmd-Shift-R), which will make the issue go away without killing the process. |
See libuv/libuv#482 (comment) for some discussion on this issue. |
I see this issue constantly on my system, usually after my Mac sleeps and wake-up, the signal helper process will be at 100% CPU and I have to force-quit signal (which is hung). I'm running MacOS Monterey 12.2. |
BTW, the "hardware melting feature" of Signal isn't really happening to macOS app exclusively. This is just a bad development all around. |
@onyx4 @lucashawro Out of curiosity, do either of you have any VPN application installed? Unsure whether the libuv+VPN issue affects iOS, but just thought I'd ask... |
No, except for the Private Relay that I keep ON |
The private relay is a clue. It's likely using the same technology (transparent proxy) underneath that's causing this issue. @EvanHahn-Signal did you get a chance to look at libuv/libuv#482 (comment)? There could be an easy fix that could provide relief on MacOS for sure if Signal upgrades libuv to the version that has the fix referenced from the discussion above... |
Yes I do have a VPN app installed but most of the time I am not connected.
Thanks,
Christian
On Feb 7, 2022, at 5:17 AM, Lucas ***@***.***> wrote:
@onyx4 <https://github.com/onyx4> @lucashawro <https://github.com/lucashawro> Out of curiosity, do either of you have any VPN application installed? Unsure whether the libuv+VPN issue affects iOS, but just thought I'd ask...
No, except for the Private Relay that I keep ON
—
Reply to this email directly, view it on GitHub <#3542 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACQKI4VNHGV7OYRGVFAQJH3UZ7A6FANCNFSM4IQCD6BQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.
|
I opened a PR to electron to backport the libuv patches: electron/electron#32856 . Thanks for letting us know about the fix! |
FYI -- I've noticed this creeping back upwards again after it was fixed at one point, but it's not as bad as it was in the past, nor is it as bad as Discord currently, so I think we're just stuck with some upstream Electron macOS renderer optimization issues, unfortunately nothing exceptional at this point. |
Just to provide some additional data points, on my Macbook (early 2015; Monterey 12.4) I have Signal constantly running in the background, this is my idle experience: I am directly connected to my WiFi, no VPNs or anything of that nature. While using this I also have Signal open on my Windows desktop as well as my Android mobile phone. So hopefully this shows that the problem is not as easy to pinpoint as some people in this issue are trying to make it sound like. |
@luv2dnce33 Please consider providing a debug log and profile (from the Performance tab in the dev tools). |
I'm on a Macbook Pro 2023, M2, and the Renderer helper process idles at about 40% when a chat with messages is open. When I have no chat selected (e.g. fresh startup), or a chat without any messages in it, it's almost 0% CPU. As soon as I open any chat with messages: bam, 20-40%. What kind of debug logs do you need? There's a bit of a backlog on this issue so it's hard to find the latest instructions on what's helpful here :P. The "sample" file from Activity Monitor? And what would you want me to do while sampling--switch between with/without messages, or would you rather have two separate samples: one with, one without? How long would the sampling be , a few seconds? No VPN, |
Same symptom as @hraban. If I open Signal, negligible CPU usage. I then open either "note to self" or the chat with my wife (but no active typing), Signal Helper uses 40% CPU (on an old 2015 MacBook Air). I then switched to an archived chat with no history and CPU usage is back to zero. Is there some sort of --verbose flag that can capture activity for diagnosis? I never noticed this behavior before the past few days. [update 2023-08-03 ]Using 6.28.0-beta.2 for about a week now, the CPU usage issue has not yet returned. Many thanks for your work! |
We've made a change to improve this in the latest beta - please consider installing it and seeing if it improves CPU usage for you: https://support.signal.org/hc/articles/360007318471-Signal-Beta |
@scottnonnenberg-signal I'm running the beta version and so far I don't see the CPU usage issue. I'll follow up after several days. [update 2023-08-03 ]Using 6.28.0-beta.2 for about a week now, the CPU usage issue has not yet returned. Many thanks for your work! |
Beta version fixed it for me |
Cool, glad it's fixed, following it up with another PR to optimize timeline scrolling more generally, but I'll treat that as a separate issue and close this. |
I was also seeing this issue (high CPU when viewing a conversation, but no rainbow-ball/lock/crash) using Signal 6.26.0 on macOS 11.7.7, running on 2020 Intel MacBook Air (retina). I tried the beta, and it doesn't show this bug, however the beta doesn't have any history, and I suspect the original rendering bug was triggered by longer conversations... my main purpose of using the desktop app is to keep the history, it's much easier to search than on the phone, and I have preserved data between 2 phone upgrades and 1 laptop upgrade. If there's a way to import history file(s) into the beta, I can test that theory and report back. Otherwise I will just cross my fingers and hope the fix makes it from beta->production. |
@spawnflagger if it's any consolation, I have a very short expiry date for all my chats and the cpu hogging seems unrelated to length of history. The behavior seems more |
@spawnflagger @hraban Have you seen any CPU usage improvements on Desktop 6.27.0? |
on 6.27.1 (auto update), the behavior is much improved. |
Nope seems fine now. Thanks. |
Can somebody ban this person from the Signal organization's projects? |
Bug Description
Signal Desktop GUI hogs CPU when updating (scrolling, new message, notification, etc)
Steps to Reproduce
Actual Result:
Watch in top "Signal Helper" eat 100% CPU and Window Server and kernel_task go as high or even higher. The machine suddenly feels very sluggish. If you have a HD video playing from e.g. YT it will skip frames or hang.
Expected Result:
Reasonable CPU usage for basic GUI operations.
Screenshots
While scrolling debug log (contact list edited out of the screencap)
Platform Info
Signal Version: 1.26.2
Operating System: macOS 10.14.6 (18G87)
Linked Device Version: iOS 2.41.1.2
Link to Debug Log
https://debuglogs.org/13972c93626c56ed01526c541854dcdca5c55f6f383795ac795c4467eb505ea6
The text was updated successfully, but these errors were encountered: