caprine icon indicating copy to clipboard operation
caprine copied to clipboard

High CPU usage

Open donluca opened this issue 2 years ago • 22 comments

Caprine, while not doing nothing, is using 12% of my CPU.

This is way too much and it's inexcusable as I'm not using it, I'm not messaging, there are no GIFs or videos playing or anything.

donluca avatar May 26 '23 21:05 donluca

Same here. It freezes up while typing and needs to be restarted again. In between it works though.

rosoau avatar May 28 '23 21:05 rosoau

What are the specs of the machine you're using? Electron (the framework Caprine is made with) tends to be more resource intensive than other frameworks.

dusansimic avatar Jul 13 '23 08:07 dusansimic

Base model Mac Mini M1, 8GB RAM (30% free, not swapping) and 128GB HD

donluca avatar Jul 13 '23 10:07 donluca

Are you using Apple Silicon variant or the Intel variant and running on Rosetta?

dusansimic avatar Jul 14 '23 09:07 dusansimic

Apple Silicon

donluca avatar Jul 14 '23 10:07 donluca

I am on openSUSE Tumbleweed, Caprine Flatpak. My CPU is Intel i5-8250U. I also have this issue randomly. Once this happens, the UI becomes unresponsive.

archerallstars avatar Jul 16 '23 03:07 archerallstars

Same very high CPU usage happens on Linux Mint 21.1 and Intel i5-8300H.

Invactive avatar Jul 17 '23 13:07 Invactive

Uses up an entire thread on my machine (!) Ubuntu 22.04 with Ryzen 5 3600X

WillMatthews avatar Aug 12 '23 19:08 WillMatthews

This occurs quite often for me as well on Linux. Doesn't really impact usage of my machine (i7-1260P), but I know it's time to restart caprine with I hear the CPU fans whirring while my machine is otherwise idle.

cbeley avatar Sep 02 '23 20:09 cbeley

Same as @cbeley on ubuntu 22.04. I have the same processor in my laptop and the fans are almost always silent. When they spin up the first thing I look for in top is caprine. If it's at 100% I restart it and it resolves. It also doesn't appear to have the latest chat updates when this happens as there are new chat messages after restarting. Seems hung on some update process.

stuckj avatar Sep 12 '23 16:09 stuckj

I've, in fact, determined this happens on EVERY new message received in caprine for me. I'm using 2.58.1 from the snap store. I'll try the 2.58.1 AppImage from github and see if it's a snap-specific issue.

stuckj avatar Sep 12 '23 17:09 stuckj

Happens with the 2.58.1 AppImage as well. So, it doesn't appear to be a snap-related issue. At least it's easy to trigger the issue. Any place I can record debug info or anything. I'm happy to help debug it. I'm a dev and currently work on react-native and react with gatsby though never with electron. :-P Any pointers on where to look at debug logs or debugging electron apps?

stuckj avatar Sep 12 '23 17:09 stuckj

The 2.58.0 AppImage works fine. This appears to be a regression in 2.58.1 (at least, for me). At least the diff looks pretty small: https://github.com/sindresorhus/caprine/compare/v2.58.0...v2.58.1#

I noticed there's no deb for the latest 2.58.1 release also. Not sure why.

stuckj avatar Sep 12 '23 18:09 stuckj

Happened on 2.58.0 now as well. I see now looking in the issues that there are lots of related issues (involving lockups) and the consensus appears to be that it's from the messenger website (since caprine's just rendering that in electron). I'll try the website directly in brave (which is also chromium-based) and see if it's happening in there too. Sounds like it's something FB has to fix...though it looks to have been a year so kinda surprising they'd leave something like that broken so long. :-P

stuckj avatar Sep 16 '23 16:09 stuckj

I have never seen this issue when using Facebook Messenger on the web in Chrome or Brave. The reason I use Caprine is because I try Firefox, which doesn't work with Messenger at all. Then, this issue occurs right away.

Now, I don't use Firefox anymore, I am on Brave using Facebook Messenger is no longer an issue. I open the window all the times as a PWA. I have never seen high CPU usage.

archerallstars avatar Sep 16 '23 16:09 archerallstars

@kreaninw @stuckj @cbeley Might be an Electron issue, can you try my fork with Electron 22 > https://github.com/Alex313031/caprine-ng

Alex313031 avatar Sep 30 '23 16:09 Alex313031

Now Caprine is using 75% to 100% of a CPU core.

Version 2.59.1 $ uname -a Linux hosanna2 6.6.6-76060606-generic #202312111032~1702306143~22.04~d28ffec~dev-Ubuntu SMP PREEMPT_DY x86_64 x86_64 x86_64 GNU/Linux

jkugler avatar Jan 12 '24 21:01 jkugler

Interestingly, it was ok for quite a while, but last week or two I've started noticing my fans whirring up again. Sure enough, it was Caprine.

cbeley avatar Jan 14 '24 23:01 cbeley

I've also noticed that this has become more a problem in the last few days on v2.59.1. I've noticed that the process which seems to be using the most CPU resources has --type=renderer:

$ ps -C caprine -o %cpu,%mem,cmd
%CPU %MEM CMD
 0.0  0.4 /usr/lib64/caprine/caprine --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer --ozone-platform=wayland
 0.0  0.1 /usr/lib64/caprine/caprine --type=zygote --no-zygote-sandbox
 0.0  0.1 /usr/lib64/caprine/caprine --type=zygote
 0.0  0.0 /usr/lib64/caprine/caprine --type=zygote
 0.6  0.2 /usr/lib64/caprine/caprine --type=gpu-process --ozone-platform=wayland --enable-crash-reporter=671ad309-5663-461d-9c4b-8be054ed217c,no_channel --user-data-dir=/home/miren/.config/Caprine --gpu-preferences=WAAAAAAAAAAgAAAYAAAAAAAAAAAAAAAAAABgAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAOAAAAAAAAAAAAAAAAAAAABAAAAABAAAACAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAACAAAAAAAAAAIAAAAAAAAAA== --shared-files --field-trial-handle=0,i,6472731342252676630,8635904168276324115,131072 --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer --disable-features=SpareRendererForSitePerProcess
 0.0  0.1 /usr/lib64/caprine/caprine --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-GB --service-sandbox-type=none --enable-crash-reporter=671ad309-5663-461d-9c4b-8be054ed217c,no_channel --user-data-dir=/home/miren/.config/Caprine --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,6472731342252676630,8635904168276324115,131072 --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer --disable-features=SpareRendererForSitePerProcess
22.7  0.8 /usr/lib64/caprine/caprine --type=renderer --enable-crash-reporter=671ad309-5663-461d-9c4b-8be054ed217c,no_channel --user-data-dir=/home/miren/.config/Caprine --app-path=/usr/lib64/caprine/resources/app.asar --no-sandbox --no-zygote --ozone-platform=wayland --lang=en-GB --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=6 --time-ticks-at-unix-epoch=-1705484196745031 --launch-time-ticks=1391179521 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,6472731342252676630,8635904168276324115,131072 --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer --disable-features=SpareRendererForSitePerProcess
 0.0  0.1 /usr/lib64/caprine/caprine --type=renderer --enable-crash-reporter=671ad309-5663-461d-9c4b-8be054ed217c,no_channel --user-data-dir=/home/miren/.config/Caprine --app-path=/usr/lib64/caprine/resources/app.asar --enable-sandbox --ozone-platform=wayland --lang=en-GB --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=7 --time-ticks-at-unix-epoch=-1705484196745031 --launch-time-ticks=1391694286 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,6472731342252676630,8635904168276324115,131072 --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer --disable-features=SpareRendererForSitePerProcess
 0.0  0.1 /usr/lib64/caprine/caprine --type=utility --utility-sub-type=audio.mojom.AudioService --lang=en-GB --service-sandbox-type=none --enable-crash-reporter=671ad309-5663-461d-9c4b-8be054ed217c,no_channel --user-data-dir=/home/miren/.config/Caprine --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,6472731342252676630,8635904168276324115,131072 --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer --disable-features=SpareRendererForSitePerProcess

Presumably there are some server side changes which Caprine has not been updated for.

I'm running Fedora 39 KDE on kernel 6.6.11.

mirenradia avatar Jan 17 '24 13:01 mirenradia

My "solution." (In Chrome)

  1. Go to https://www.messenger.com/
  2. Click on the "three dot" menu (Top right)
  3. Click "Save and Share"
  4. Click "Create Shortcut..."
  5. Name it "Facebook Messenger", check "Open as window," and click "Create."

You now have a Messenger "app."

jkugler avatar Jan 24 '24 20:01 jkugler

@jkugler I wanted to do that, but I couldn't find a way to turn on dark mode. So, I ended up creating the app out of facebook.com instead.

archerallstars avatar Jan 25 '24 02:01 archerallstars

After last update it takes around 30-40% of my CPU when window is up, but 0% when minimized. Browser doesn't behave like this.

maxoku avatar Feb 19 '24 18:02 maxoku