Ximi1970 / systray-x

SysTray-X: A system tray extension for Thunderbird. Needs both the addon AND the companion app installed to work. Will not work with TB flatpaks or snaps.
Mozilla Public License 2.0
217 stars 14 forks source link

Application lagging #10

Closed mpamps closed 4 years ago

mpamps commented 4 years ago

Normally Thunderbird uses 200MB. When SysTray-X is installed RAM usage is 3.0-5.0GB. Also Thunderbird becomes unusable. There is a huge lag after each click. CPU usage does not exceed 20%.

OS: Linux Mint 19.3 Tricia (base: Ubuntu 18.04 LTS) - 64bit Thunderbird: 68.7.0 (64-bit) SysTray-X: 0.1.2 QMake version 3.1 Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu

Ximi1970 commented 4 years ago

And the desktop your are using? Cinnamon, MATE, Xfce? Thanks!

mpamps commented 4 years ago

It's Cinnamon. Regards

Ximi1970 commented 4 years ago

I installed Mint 19.3 clean in a VirtualBox with 4Gb mem and 2 cores (3.3Ghz). Using the default installed TB 68.4.1 en the SysTray-X package installed from the xUbuntu 18.03 repository mentioned in de Github README.md, I can not find any problem. (Except for the known problem of hiding to the tray not working in 18.04 Ubuntu versions)

Thunderbird is indeed using about 2.5 - 3Gb virtual memory and 250 - 300 Mb physical mem. and uses about .7% CPU in rest, with or without the add-on installed. As soon as the add-on needs to poll the mail CPU usage will increase for a few seconds depending on the number of mail accounts. Be aware that a continues high CPU load indicates that the default poll time of version 0.1.2 is way to low for your system. Increase it to 30 secs in the preferences. New versions of the addon will have 30 secs as default. Hope that will be enough for older systems.

mpamps commented 4 years ago

My account has a really large number of emails with about 20 folders. So I created another profile, added an account with only a couple of emails and it worked fine. So I guess this is not OS/Desktop related.

I switched back to the other profile and I changed the polling interval. Things got better but no unread messages count any more in the tray icon. I reverted the value back to 5, but strangely enough no lag but still no unread messages count.

I reinstalled systray-x but still same behaviour.

Ximi1970 commented 4 years ago

If you open the Activity manager (under Tools) or click on the bottom bar of TB, can you see any ongoing activity of TB. The (old?) TB would regularly hang on getting gmail imaps for example. As long as TB is busy, I think no polling will be handled and there will be no number as result.
I still need to recheck if a clean install will set the right filters from start or that you have to press the save button once in the preferences. This could also result in a wrong unread count.

hockeymikey commented 4 years ago

I too am seeing this high ram usage. Normally I'm running about 300mb, but with the addon I'm seeing 1gb+, and I think once I saw it breaking 3gb. I'm using KDE neon, 18.04. I have about 6 different email accounts, a few smaller custom ones, gmail, a hotmail, two outlook365s. The moment I disable the addon in Thunderbird the ram goes back to normal and as soon as I enable it, spikes back up in 5 seconds.

mpamps commented 4 years ago

If you open the Activity manager (under Tools) or click on the bottom bar of TB, can you see any ongoing activity of TB. The (old?) TB would regularly hang on getting gmail imaps for example. As long as TB is busy, I think no polling will be handled and there will be no number as result. I still need to recheck if a clean install will set the right filters from start or that you have to press the save button once in the preferences. This could also result in a wrong unread count.

Currently the systray-x addon is working smoothly. Polling interval is set to 5. No high RAM usage or CPU consumption. The issue with the unread count seems to be due to to the folders. It counts only the unread messages in the Inbox. Any unread messages in any another folder are not taken into account.

Ximi1970 commented 4 years ago

@hockeymikey @mpamps how do you determine the memory usage?
And another distro to try...

mpamps commented 4 years ago

For all my comments so far, I was looking at the "System Monitor" app. At this point that Thunderbird is running ok with systray-x enabled the System Monitor reports that memory for the thunderbird process is 300MB. Since in one of your comments you mentioned virtual and physical memory, I guess that you want data from the "top" command. According to "top": VIRT: 3365.4m RES: 446.3m SHR: 140,0m

hockeymikey commented 4 years ago

@Ximi1970 What's another distro? I use ksysmonitor, the default that comes packaged but htop tells the same story.

Ximi1970 commented 4 years ago

Never heard of KDE Neon before. That is another "distribution" based upon Ubuntu. All those variations (of we know it better) is really getting ridiculous. At the moment I have these distributions in my VirtualBox for testing: openSuSE Leap 15.1 openSuSE Leap 15.2 (beta) openSuSE Tumbleweed 32 and 64bit

Ubuntu variants: Ubuntu 19.10 Ubuntu 18.04 Kubuntu 18.04 32 / 64bit Xubuntu 19.10 Xubuntu 18.04 Mint 19.3 Cinnemon KDE Neon 5.18.4

I have been using (open)SuSE (using the KDE desktop) for about 25 years now and still staying with SuSE. Before that I used Redhat (InfoMagic), Yggdrasil and ??. Been a linux fan since kernel 0.99. (1992)

hockeymikey commented 4 years ago

@Ximi1970 KDE neon is from the same people that do Kubuntu. They are the same except neon is on a rolling release for KDE while Kubuntu KDE follows the release pattern of Ubuntu which is like 6mo. Been using Linux since middle school for servers, pretty much just Ubuntu, little CentOS for work but I'm happy where I'm at too. Not a distro hopper. Arch seems interesting, might play with it someday but *Ubuntu I'm most familar with, stable and good support. Dang, I wasn't even born then haha

mpamps commented 4 years ago

@Ximi1970 As I said earlier, systray-x seems to run smoothly right now (regarding cpu & memory).

Should I open another ticket regarding the unread messages inside folders?

Ximi1970 commented 4 years ago

@mpamps not necessary I will put it on my todo list !

ghost commented 4 years ago

Can confirm this on windows x64. Set to 60 and lags up to 2-3 gigs of ram. Unusable because this takes 10-20 seconds to click anything. Disabling the addon while running causes the lag to instantly stop.

Ximi1970 commented 4 years ago

Please try the new release 0.1.5

jcldc commented 4 years ago

Hi, using release 0.1.5 on Kubuntu 20.04, and it still hogging memory and lagging when composing an email.

Ximi1970 commented 4 years ago

@jcldc How did you determine the memory hog? TB uses standard +-200-400 Mb of real mem and 2-4Gb of virtual mem. and I cannot see any significant increase using the top command when installing / using systray-x.

I also cannot reproduce the lagging mentioned in this issue. Except when TB is downloading the mail of newly installed huge mail accounts. But that is also standaard TB behaviour. Can you tell me how many email accounts, number of mails and account types you are using (IMAP, POP, Exchange)? Maybe some protocol is killing the mail query Webextension API some how. Thanks!

jcldc commented 4 years ago

I am using 2 emails accounts, both with IMAP protocol.

Actually, I don't know if the memory pb is really relevant, but the lagging definitely yes. It occurs while I am composing an e-mail, only if systray-X addons is activated. It's like there is an extra event loop which is running during mail composition involving extra cpu cycles. The lag disappear if systrax-y addons is deactivated.

jcldc commented 4 years ago

I did not mention that I have 40 000 emails in my mail box, which don't cause any trouble for using TB whatsoever.

Ximi1970 commented 4 years ago

I know, I got 20 accounts (IMAP, POP) and about 12,000 mails.

What polling times do you use? (can be changed in the systray-x preferences)

Because at every poll, TB needs to scan those 40000 emails for unread mails. And that probably will take some time...And if you have a very short polling time, your system will be continously being busy with scanning. The current web extensions API for unread mails is really really bad.

Ximi1970 commented 4 years ago

How many folders did you select to check for unread mails?

jcldc commented 4 years ago

I am using the default polling time (60). I have only selected one folder (inbox folder) for each account. Are you sure that TB needs to scan 40000 emails to check unread emails ? That's not smart. I guess there is a better mechanism, don't you think ?

Ximi1970 commented 4 years ago

Finallly can replicate the lagging. Still cannot determine what causes the huge CPU load. Is it the number of filters I need to use to check the unread or the number of mails in a folder or both?

You have most of your mails still in the Inbox?

At the moment I think there is no other way to check the unread mail. There is a new method added for TB76 and there is also something called Experimental webextensions API. I really need to look into that now. Hopefully all the window problems are now solved for all platforms. That took a lot of my time the past two months.

Lagging problem is now number 1.

See also #8

jcldc commented 4 years ago

Thanks a lot for the time being passed developing that very useful extension for TB. And good luck for the lagging problem ! Jean-Charles

Ximi1970 commented 4 years ago

Found a way to use the old Firetray listeners. No more polling and hopefully, no more lagging. Please checkout 0.2.1.

mpamps commented 4 years ago

No lagging here. Everything works smoothly. CPU & RAM usage are back to normal. Great work! Thanks!

ghost commented 4 years ago

Same here. Win 10 64 all good so far! Thanks

On Tue, May 26, 2020 at 10:10 AM mpamps notifications@github.com wrote:

No lagging here. Everything works smoothly. CPU & RAM usage are back to normal. Great work! Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ximi1970/systray-x/issues/10#issuecomment-634049311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKS36SMOEFOWOLRJOJRWXLRTPET5ANCNFSM4MERHQHA .

jcldc commented 4 years ago

Yes works smooth now. Good job !