Tdesktop: High CPU load

Created on 9 Jul 2017  路  109Comments  路  Source: telegramdesktop/tdesktop

Steps to reproduce

  1. Simply start Telegram
  2. Let it run for a while (could be hours or even days)
  3. At some point it will start consuming lots of CPU

Expected behaviour

It shouldn't spend all that CPU load

Actual behaviour

It just consumes CPU time till the program is restarted

Configuration

Operating system:
Fedora Linux 25 on one i7 laptop and one i5 desktop. Same thing on an Ubuntu 16.04 laptop.

Version of Telegram Desktop:
1.1.11 (previous versions too. IIRC 1.0 was ok)
Used theme:
Any theme

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

bug

Most helpful comment

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

All 109 comments

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).
screen shot 2017-07-19 at 11 46 54 pm
And this is the local storage:
screen shot 2017-07-19 at 11 51 23 pm
After clearing the local storage now the issue seems to be fixed for me:
screen shot 2017-07-20 at 12 00 34 am

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

4238

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:

  1. a chat has a message from @gif which is animated and is on screen (on page) right now.
  2. telegram starts playing a song from any music channel (e.g. https://t.me/ifletov).

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 :(
d1288351
79c1108e

Using Windows 10. CPU usage is acceptable at ~0,4 with no chat opened and minimized. But I think Telegram should use less than that in this situation. Took a screenshot from the threads CPU utilization:
image
No idea about why Telegram calls PlaySoundW if there is no sound to be played...

for me it takes about 5 minutes to start up while hogging a whole cpu core at 100%

One year after, the problem still exist...

It appears (at least for me) that something in the stored configuration became corrupted - and this issue continued to be propagated between releases. What I did was to completely remove from my system (un-install and then manually delete all the saved settings). I then installed and configured everything as if I was a first time user. This fixed the issue for me.

If you uninstall, reinstall and you aren't prompted to enter your phone number again, you didn't get rid of everything. You must erase all traces of the previous installation to ensure you delete whatever was corrupted.

On Fedora Linux, this means to remove the directory that contains the telegram executable AND to also delete the hidden .TelegramDesktop directory AND .local/share/TelegramDesktop AND .config/autostart/Telegram.desktop

If you are on another platform, you'll need to research where all the files are hidden, then manually get rid of them.

Hope this works for others - it worked for me.

The ones who have problems with their macs, I have bought a new one (with touchbar) and the problem is disappeared.

Fixed.
馃槅

Ubuntu 18.04 MATE, telegram 1.4.3 eat 30-40% CPU (i7, 8 cores).

Also having this issue.
System: Linux Mint 18.1 Serena EDITION="Cinnamon 64-bit" TOOLKIT=GTK
CPU: AMD Phenom(tm) II X4 960T Processor 2.3 GHz

I can confirm that CPU High usage is linked with GIF menu.

The same problem. 30-40% CPU load. Macbook pro, 2018 mid, core i5. MacOS Mojave 10.14

I'm having this problem on version 1.1.23 on Debian Stretch. It happens only when I am viewing or minimize the app while viewing the chat area of two specific groups, but not other groups. It does not happen when I close the app to the tray. It does not matter if the side panel with emojis, stickers and GIFs is displayed or not, or which tab is selected. If, on the group chat area, I click the group name, showing the group members, the problem goes away. So if I move to other groups or private conversations. One of the groups is quite old (more than 1 year), the other one was created only a few days ago (less than two months). The oldest group, with 9 members, has a significant amount of media: 736 photos, 5 videos, 10 files, 1 voice message, 1903 shared links. The newest, with 8 members, only has 50 photos and 113 shared links. Some of the members had been offline for more than a month, but are back now. I have tried clearing the global storage, but it made no difference. I may have to clear the group's history, but honestly I don't want to. I've checked that the CPU spike happens regardless of which content in the group chat is being viewed, and that the same kind of content (website links with a preview, photographs, YouTube video previews) does not cause a CPU spike when viewing private chats. The two groups were pinned, I tried unpinning, and also silencing them for one hour, but none of those things made a difference. So I think the problem may be some sort of data corruption on those groups' chat history. While I was writing this, the CPU spike stopped happening on one of those groups. The only different thing was that someone had replied one of my messages. Then I tried sending a message with no media, just text, and the problem didn't return. On the other group it still happens. The last message was mine, it was a YouTube link with a preview. So I tried sending a GIF with @gif. Nothing changed, still one group spikes and the other (where I sent the @gif) does not. Then I tried posting a YouTube link. No change still. Re-enabled notifications, sent a GIF, nothing changed. Sent another YouTube video. Brief spike while generating the preview, but nothing else. Switching to the other group still maxes out the CPU again. Restarting the app makes no difference, still one group produces a CPU spike and the other does not.

Same problem. 50-80% CPU load.
Macbook pro
MacOS Mojave 10.14

This is certainly still a problem, MacBook pro, MacOS Mojave.
usually hovers around 8-9 percent. After restarting telegram it consumes about 4%.

This is contributing to a warm laptop with lower battery life.
I think it is still actively rendering stuff like gifs even when the app is in the background (on another workspace, or full screen but not active).

image

This is getting absurd.

Lightly lowered CPU load: disabled animations and autoplaying GIFS.
selection_070

Telegram Desktop 1.4.4 Beta

Same problem after sleep. Telegram 1.4.3. Windows 10 1809
image
image
and after i reopen telegram
image

After being computer in a sleep for 10 hours, telegram started consuming cpu for about 20 seconds on my Core2 Quad 3GHz.
image
It looks like QT is accumulate events every second, and after computer being in a sleep there is a gap in time. so qt have some events to process.
image
image

I notice this when someone is typing a message if that helps (sorry, I didn't read the whole thread, perhaps someone already reported that).

I can confirm the behavior as mentioned by @heaven. As soon as the "typing..." animation is running, I get quite high CPU load. (macOS 10.14.3 (18D109))

Same problem Kubuntu 18.04. Leave telegram run for a while and CPU on my 4 cores maxes out. The app is version 1.5.15 and was installed via snap

Using between 30-40% most of the time.
Some things I observed too: everytime you open the gifs panel or play a music on it, it spikes to almoost 100% cpu usage then get back to ~35%

Telegram 1.5.15 (downloaded the binary from official page).
Manjaro (mate) 18.0.1.

Same thing for me. Leaving telegram open makes CPU jump to 80 degrees celcius. Maxed out Macbook pro 2018 MacOS Mojave 10.14.3

Yes, after night sleep my Telegram start consuming about 1 CPU core quite a long time, I should restart it ti stop waisting my Mac performance...
Telegram 1.15, Mac OS 10.14

Just to add to everything already here... I have a dodgy wifi connection and whenever it drops, Telegram goes to 100% almost immediately. I suspect this is because of the "connecting..." animation, much like the "typing..." animation, which I also experience.

Same thing here. I decided to stop using the desktop and fallback to the web version in hope it consumes less CPU.
From time to time, my fan makes my computer look like a jet engine and when I check telegram is at 50%~90% CPU usage.
maxed out macbook pro 13 2015 (except for the ssd). Using macOS Mojave 10.14.4

image
Telegram v1.7.10
Windows 10 1903

The same for 1.8.1 on Linux/Manjaro box running KDE. Sometimes the app constantly eats 22-23% without any UI activity (and never less than 6%). Percentage are for Intel i5-6600. At first I was sure it just eat one CPU core. But looking at the load graph I have found all four cores are in use more or less equally.

Same for me on Fedora 30, Amd cpu+gpu, fully updated

Consumes crazy amounts of CPU power. 50% with active window without scrolling and up to 80% with scrolling. My MacBook Pro i7, 16gb ram 2017 is spinning up the fans non-stop

Sometimes, 99% CPU usage and 600-800 ram usage. TG Desktop 1.8.8., Windows 10 1903

Still an issue on Linux 5 and TG Desktop 1.8.15

This issue is over 2 years old already. Very professional approach! But we have animated stickers. Of course stickers are much more important!

This issue is over 2 years old already. Very professional approach! But we have animated stickers. Of course stickers are much more important!

I think this problem has too many factors so each case should be resolved separately.

This issue is over 2 years old already. Very professional approach! But we have animated stickers. Of course stickers are much more important!

I think this problem has too many factors so each case should be resolved separately.

i supplied multiple valgrind logs, but no one looks to have the knowledge to fix the issues and with that maybe the high cpu load.

This issue is over 2 years old already. Very professional approach! But we have animated stickers. Of course stickers are much more important!

I think this problem has too many factors so each case should be resolved separately.

As once Buddha said, there are only two mistakes one can make along the road; not going all the way, and not starting. 0 comments from devs, 89 from angry users.

@chapati Be Patient or make a pull request

some memleaks where fixed making cpu load to drop.
i want to know if everyone thinks this bug is fixed.

I don't have this problem a long ago)

My previous comment was on Oct 18, 2018

some memleaks where fixed making cpu load to drop.
i want to know if everyone thinks this bug is fixed.

What version are you talking about? Last update some days ago, fedora 31 - CPU goes up after ~30 minutes

Can confirm on Manjaro. It's fine at first and then suddenly I check "top" and the application is consuming over 40% of one of my i5 cores.

What version are you talking about? Last update some days ago, fedora 31 - CPU goes up after ~30 minutes

As a follow-up. A version from testing repo (1.9.8) works well after ~1 day of usage. Non-testing version 1.9.4 consumes CPU

plz test only desktop.telegram.org or github releases build, i have seen it distribution based packages to give bugs not present on official releases.

On Windows 10 the 1.9.9 version used half a cpu core all night for me despite telegram being in the background.

Interestingly the cpu usage is about the same as if i open the smiley > gifs tab.

I've tried both the official Manjaro package and the one available on desktop.telegram.org and they show the same unusually high cpu usage still.

I get high CPU usage as well, sometimes it drops extremely low, but other times it spikes up using quite a bit (on the same menus)
I do have lots of groups and chats added, with gifs and images going through them constantly, but they shouldn't be doing anything unless I actually open the chat. Assuming that might be the issue.

Windows 10, TGDesktopVersion: 1.9.14

High CPU usage on Debian (60%).
All chats are closed.
perf shows TG decodes some video:
$ perf report |grep -v '^#' | head -3
8.54% QThread Telegram [.] ff_h264_decode_mb_cavlc
2.47% QThread Telegram [.] ff_h264_filter_mb_fast
1.49% QThread Telegram [.] 0x00000000019f1ce1

Telegram 1.9.14

your is very likely #6312 (comment)

Not sure, there are no any chat opened and no any video are played. Seems like TG don't cancel video decoding.

@rmrfchik Go into a chat, mouse over the emoji button, change the tab away from gifs to emoji, close the chat. Then check your CPU again.

@wchristian it helped at once! thanks!

@rmrfchik Go into a chat, mouse over the emoji button, change the tab away from gifs to emoji, close the chat. Then check your CPU again.

Seems to have fixed high cpu usage for me. It's been a couple fo days now of testing.

On Linux (Debian 10.3), the Telegram process is constantly polling, even though the UI is not animated and no message is sent nor received, as can be seen with this strace output:

$ strace -p `pidof Telegram`
strace: Process 25205 attached
restart_syscall(<... resuming interrupted poll ...>) = 0
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}], 6, 8) = 0 (Timeout)
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}], 6, 7) = 0 (Timeout)
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}], 6, 8) = 0 (Timeout)
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}], 6, 7) = 0 (Timeout)
 <...>
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}], 6, 7) = 0 (Timeout)
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}], 6, 8) = 0 (Timeout)
recvmsg(17, {msg_namelen=0}, 0)         = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=14, events=POLLIN}, {fd=17, events=POLLIN}, {fd=18, events=POLLIN}], 6, 7) = 0 (Timeout)
recvmsg(17, ^Cstrace: Process 25205 detached
 <detached ...>

@loicmolinari due to the nature of this ticket it's not really monitored, but if you can write up clear reproduction steps and open up a new ticket, that'll have better chances

FIX IT

FIX IT

While I agree with the idea that it would be good to fix bugs, I disagree with the way the demand is stated. Did you forget the magic word?

in this situation on amount of "please" would help, as @loicmolinari still needs to provide repro steps

in this situation on amount of "please" would help, as @loicmolinari still needs to provide repro steps

Still, it would improve the discourse for no cost at all. I don't know whether @loicmolinari gets paid to work on this project but - this being GH - I generally assume most people around here are volunteers. When I volunteer to do something I tend to dislike being commanded to FIX SOMETHING...

i've released so much open source and my experience says: don't make a fuss of it unless it is targeted harrassment, as the fuss always tends to be bigger than the event itself. :)

https://metacpan.org/author/MITHALDU

I don't know whether @loicmolinari gets paid to work on this project

He just wrote a comment with strace as an affected user, isn't it? o_O

FIX IT

Let's rewrite the whole animation engine, do a good deed for everyone!

Hey there!

This issue will be automatically closed in 7 days if there would be no activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

FIX IT

While I agree with the idea that it would be good to fix bugs, I disagree with the way the demand is stated. Did you forget the magic word?

Mate, no one is going to play nice, people begged for years and no one did stuff, if you are 3rd rate dev looking to beef up your student CV and half-assedly do it then do people a favour and don't. A professional organisation will take it under its wing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArmeF97 picture ArmeF97  路  3Comments

slowaways picture slowaways  路  3Comments

Justinzobel picture Justinzobel  路  3Comments

ghost picture ghost  路  3Comments

luisalvarado picture luisalvarado  路  3Comments