Closed kmare closed 3 years ago
Same problem on i7/macOS Sierra/tdesktop 1.1.10
I can reproduce this problem too on Ubuntu 16.04 (laptop)
I had the same problem here, i7 desktop, and a laptop, both with Fedora 25.
I've noticed this too on Ubuntu, even more so when someone is typing a message/just posted it seems to spike up. Which is especially problematic when gaming.
Same here. also lots of disk usage ... i7/laptop/Win10
Is there a way we could help the developers debug the issue? It seems like it's not OS or build specific..
@kmare Is Sticker/GIF panel enabled? Is something playing? Are there any GIFs on screen? What if you defocus the app?
@stek29 No, the sticker/gif panel is hidden, nothing is playing, no gifs on scree. Moving the focus off the app won't help either. The only way to kill all these QThreads is to quit the app and restart it. So yeah, unfortunately I still haven't figured out what's causing the spawning of all these QThreads causing the high cpu load. At this moment, it looks so random as it could happen after a few minutes or a day.
I was basically facing the same issue of high cpu load, as high as 140% on mac osx sierra with latest telegram desktop update (1.1.10 as of now) but I've had this issue on previous versions too, after digging for a little bit I found out that my local storage has caused an integer overflow (2244). And this is the local storage:
After clearing the local storage now the issue seems to be fixed for me:
@silverfoxy that's actually interesting. I checked my local storage and it seems fine though. So I guess, at least in my case, it has to be something else. Thank you for reporting that though!
same problem in ubuntu 14.04 and 16.04. It starts to use a lot of cpu for no reason.
Same here on Debian (Sid) 32bit on a Thinkpad T42p, Telegram takes more and more and more CPU after a (short) while. Tracing the process does not show much more than endless calls to clock_gettime
, poll
, recvmsg
and futex
:
[pid 32000] poll([{fd=6, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}], 4, 399 <unfinished ...>
[pid 32031] clock_gettime(CLOCK_MONOTONIC, {tv_sec=451257, tv_nsec=102094921}) = 0
[pid 32031] poll([{fd=30, events=POLLIN}], 1, 0) = 0 (Timeout)
[pid 32031] clock_gettime(CLOCK_MONOTONIC, {tv_sec=451257, tv_nsec=112063820}) = 0
[pid 32031] poll([{fd=30, events=POLLIN}], 1, 0) = 0 (Timeout)
[pid 32031] clock_gettime(CLOCK_MONOTONIC, {tv_sec=451257, tv_nsec=112284246}) = 0
[pid 32031] clock_gettime(CLOCK_MONOTONIC, {tv_sec=451257, tv_nsec=112347384}) = 0
[pid 32031] clock_gettime(CLOCK_MONOTONIC, {tv_sec=451257, tv_nsec=112414434}) = 0
[pid 32031] clock_gettime(CLOCK_MONOTONIC, {tv_sec=451257, tv_nsec=112492100}) = 0
[pid 32031] poll([{fd=30, events=POLLIN}], 1, 30 <unfinished ...>
[pid 32030] <... poll resumed> ) = 0 (Timeout)
[pid 32030] clock_gettime(CLOCK_MONOTONIC, {tv_sec=451257, tv_nsec=115244212}) = 0
[pid 32030] clock_gettime(CLOCK_MONOTONIC, {tv_sec=451257, tv_nsec=115316570}) = 0
[pid 32030] clock_gettime(CLOCK_MONOTONIC, {tv_sec=451257, tv_nsec=115402338}) = 0
[pid 32030] write(6, "\1\0\0\0\0\0\0\0", 8) = 8
[pid 32000] <... poll resumed> ) = 1 ([{fd=6, revents=POLLIN}])
[pid 32030] clock_gettime(CLOCK_MONOTONIC, <unfinished ...>
[pid 32000] read(6, <unfinished ...>
[pid 32030] <... clock_gettime resumed> {tv_sec=451257, tv_nsec=115622205}) = 0
[pid 32000] <... read resumed> "\1\0\0\0\0\0\0\0", 16) = 8
[pid 32030] poll([{fd=31, events=POLLIN}], 1, 0 <unfinished ...>
[pid 32000] clock_gettime(CLOCK_MONOTONIC, <unfinished ...>
[pid 32030] <... poll resumed> ) = 0 (Timeout)
This is a relatively recent problem, it started about a month ago. Earlier versions did not show this behaviour.
I attached a running Telegram process to strace
to see where things went berzerk. Telegram behaved nicely, 0.1% CPU, nothing special. Messed around a bit, nothing special.
Then I happened to move the pointer over that #%#¤&/%/%/ smiley button which I'd rather ditch yesterday than today. The blasted popup appeared again with a hoard of moving GIF images. I clicked outside of it to get rid of the dreaded things and had a look at the trace. 5 new threads had been launched and the trace was going wild, suddenly Telegram was hogging 25% CPU. Mind, the popup was gone, no moving images in sight, all peace and quiet on the surface. Below the surface it seems some QThreads were busy doing something anyway, something which took a lot of CPU.
Then I switched the horrible emjoistickergif popup to the 'emoji' tab and closed it. The CPU hoarding stopped. Switched back to the moving misery, closed popup, NO CPU HOARDING. Switched back and forth a few times, sometimes it started hoarding CPU, other times it didn't. The interesting observation is that I never got any hoarding problems when the popup was set to 'emoji' or 'stickers' but did get it when the thing was set to 'gifs'.
@Yetangitu thank you for "discovering" that! I'll take a look at that too and see if this is what is causing the 100% CPU load with telegram spawning all these QThreads.
I can confirm what @Yetangitu said! It really works! So basically, as soon as you see the CPU load going up cause of telegram, just click on the emoji/stickers/gifs icon once, click on it again and the telegram CPU load will go back to where it should be idling! If anyone else could confirm, please do so. Hopefully the developers will find a solution.
From my observations it is enough to make sure that the popup is not set to 'gifs' before it is closed to avoid Telegram hogging the CPU. I have not seen any hogging since doing this.
Same on High Sierra Mac OS, but 1.1.13alpha takes much less resources.
@sstyle Please try the current version, v1.2.6.
@auchri I tried (you can see it here #4238) and found that 1.1.13 much better, but still has this issue.
This is just Telegram using your computers resources to create the first batch of TelegramCoin, the new cryptocurrency. Nothing to be worried about.
@pizzadude Nice. So we can close this thread )
happened to me just now
steps to reproduce: launch high cpu (for a couple of minutes) low cpu wait a little bit high cpu (for a couple of minutes) low cpu
mac 10.13.3 telegram 1.2.6
i hope telegram didnt start using our PCs for Gram mining 🤔
Same problem and I'm trying to fix it. Try turning off all notifications. So far I think it's not going crazy anymore.
I am using v1.2.6. What I saw that if telegram runs, CPU load is very high, it consumes 70% of CPU time. The only way to stop this is to minimize telegram window. If you just switch to other app, but leave it on screen, even if it's completely overlayed by another window, it won't help, only minimization helps.
Host OS: OS X 10.12.6
fwiw: I've particularly noticed this CPU issue when I've used the @gif
bot. Even after selecting a gif and the popup has gone away the CPU sits at a really high percentage unless I quit and reopen.
@remybach For me it goes down after the GIFs panel is closed :(
@john-preston The panel that's part of the popup when you hover over the emoji, or the popup when you search using the @gif
bot? I never use the emoji one so I don't know about that one.
Annoyingly, I can't 100% reproduce this. I asked a friend and when he checked his CPU spiked up to 100%, but mine hardly blipped when I just tested.
@remybach The GIFs kill the CPU in Telegram Desktop :( But when the popup hides (both the emoji-stickers-gifs and the inline bot results, like @gif one) it goes back for me.
In my case telegram starts consuming CPU in two cases:
@gif
which is animated and is on screen (on page) right now.100% reproducible.
OS: macOS 10.13.3 Telegram: 1.2.6
I found that TelegramSwift (https://github.com/overtake/TelegramSwift) does not have this issue.
TelegramSwift has low CPU load but is sluggish as hell, not better
I have the same issue on telegram for OSX. High CPU usage after first chat..
Yes. I am simply reading a group chat and my macbook glows. The chat does not allow media by the way. Only text.
After upgrade my Mac to High Sierra, CPU usage also got High.
Version 1.2.6 on MacOS 10.13.3, same behaviour. Telegram suddenly starts using a lot of CPU for no apparent reason (no gif playing or anything). Restart of Telegram fixes the issue (until it occurs again). It's a recent issue (don't know the specific version, but it did not happen as of v1.0).
I'm observing this behavior when I rapidly scroll through all of my gifs, then mouse away from the popup. My CPU usage spikes to at least 50% on my Ryzen 1700, and the app instantly eats a good 600 MB of memory.
Mousing over the gif menu, so that they briefly display again, fixes it immediately. Memory freed, CPU back to <1%
I have a number of very large MP4 files stored in there - think 1000x1000@60fps. That's probably exacerbating the issue.
It seems like Telegram is trying to render all of the videos at once, even though I'm not able to look at them, and just..getting stuck.
Also I found that CPU load is very high when someone typing to me. Loading drops If he stops typing.
Still present with the latest release (1.2.17). The client (on windows 10 in this case) get stuck in an odd state where it seems to be processing the gifs tab even when not visible. Switching to the sticker or emoji tab resolves the issue. The issue is sporadic and I haven't found clean repro steps so far.
Also I found that CPU load is very high when someone typing to me. Loading drops If he stops typing.
Same here
That's still a thing yes, latest OSX, latest TD... instant CPU spike, instant heat increase to 80C.
edit: with gifs/etc. hidden, just empty chat window with a lot of groups and private chats present but never opened, just starting the app and CPU will spike.
Made me uninstall Telegram Desktop and use mobile version only
All these symptoms - CPU hoarding on GIF, when someone is typing, etc - point at the culprit being something related to animations (tight loop running a timer?) as the typing... animation and all that moving-gif-misery share these characteristics. I haven't looked at the source yet, those who have might get an idea of where the problem lies. Maybe I should look at the source ...
...
Just looked at the source (https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/ui/animation.h probably being the most interesting part), did not directly find anything pointing at tight loops so I did the next best thing: ask $search_engine
. There seem to have been, and still seem to be a number of bugs in QT relating to high CPU load on animations. I notice that the binary served by Telegram is built with a static copy of Qt 5.6.2, current state of the art is 5.11. If anyone happens to have this installed and ready to build it might be worth comparing the result with the pre-baked version.
the same here. win 10, telegram 1.2.17
after telegram runs for a while it starts to load cpu of about 10-15% and also when someone is typing or a gif play as already mentioned above
Telegram desktop 1.2.24 alpha mac os high sierra (10.13.4) - client constantly uses more than 3% of CPU and has spikes to 10%. In IDLE state while I'm not even reading or chatting there.
I've attached sample of running application, maybe it could help telegram_samples.txt
TG for no reason starts to use 1850% of CPU. And I7-6950 Xtreme goes dead. But it really may happen because of GIF-bot as I started to use not long ago
Y'all mining crypto in the background or something?
Mac OS X 10.13.5 Telegram 1.3.9 Still an issue, out of the blue starts to eating cpu. Not even using emojis. Really annoying.
Ubuntu 18.04 here, I've tried renicing all TG processes to 19 as well and that barely does anything :/
Same here :(
Logs:
Insert logs here (if necessary)running: top -H -p will return:
top - 19:57:37 up 4 days, 21:42, 1 user, load average: 0.83, 1.34, 1.37
Threads: 20 total, 1 running, 19 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.3 us, 0.7 sy, 0.0 ni, 89.0 id, 0.1 wa, 0.5 hi, 0.3 si, 0.0 st
KiB Mem : 16291228 total, 3390260 free, 5596580 used, 7304388 buff/cache
KiB Swap: 8191996 total, 8191996 free, 0 used. 8155060 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5470 smee 20 0 2686276 653620 100172 S 10.3 4.0 8:19.68 QThread
13349 smee 20 0 2686276 653620 100172 S 9.0 4.0 7:38.81 QThread
13346 smee 20 0 2686276 653620 100172 S 7.7 4.0 6:25.81 QThread
5471 smee 20 0 2686276 653620 100172 S 6.7 4.0 5:41.01 QThread
5482 smee 20 0 2686276 653620 100172 S 6.0 4.0 5:39.49 QThread
13348 smee 20 0 2686276 653620 100172 S 4.7 4.0 3:56.05 QThread
4829 smee 20 0 2686276 653620 100172 R 4.0 4.0 4:22.86 QThread
13347 smee 20 0 2686276 653620 100172 S 3.7 4.0 3:12.62 QThread
27411 smee 20 0 2686276 653620 100172 S 1.7 4.0 22:55.85 Telegram
27412 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:33.49 QXcbEventReader
27413 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:06.78 QDBusConnection
27415 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:13.68 Qt bearer threa
27416 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:00.00 gmain
27417 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:00.08 gdbus
27432 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:00.20 QThread
27433 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:01.95 QThread
27434 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:00.00 QThread
27436 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:06.02 MTP::internal::
4205 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:00.00 Qt HTTP thread
27321 smee 20 0 2686276 653620 100172 S 0.0 4.0 0:00.00 Qt HTTP thread