Closed Bug 1817367 Opened 1 year ago Closed 1 year ago

Switching to the unified folder inbox using folder mode settings hangs with high memory, high activity in morkTableMapIter::NextTable

Categories

(Thunderbird :: Folder and Message Lists, defect, P3)

Thunderbird 111
Unspecified
All

Tracking

(thunderbird111 wontfix, thunderbird112 wontfix, thunderbird113 fixed)

RESOLVED FIXED
114 Branch
Tracking Status
thunderbird111 --- wontfix
thunderbird112 --- wontfix
thunderbird113 --- fixed

People

(Reporter: emilio, Assigned: darktrojan)

References

(Blocks 1 open bug)

Details

(Keywords: hang, perf, Whiteboard: [Supernova3p])

Attachments

(2 files)

I was playing with the folder mode settings, and as soon as I try that my Daily hangs.

My guess is that there's some quadratic algorithm going on in there or something terribly slow because I had to kill it to get a crash report

This is a somewhat massive profile. I tried taking a performance profile but daily will just not terminate :'(

Check how much memory is being used.

Severity: -- → S2
Keywords: hang, perf
See Also: → 1814964
Whiteboard: [Supernova]
Flags: needinfo?(emilio)
Version: unspecified → Thunderbird 111

(In reply to Emilio Cobos Álvarez (:emilio) from comment #0)

I was playing with the folder mode settings, and as soon as I try that my Daily hangs.

My guess is that there's some quadratic algorithm going on in there or something terribly slow because I had to kill it to get a crash report

No bug report for this signature @ nsTArray_Impl<T>::RemoveElementsAt | nsTArray_Impl<T>::RemoveElementAt | nsMsgDBView::RemoveByIndex

No bug report for this signature @ <style::gecko::wrapper::GeckoNode as style::dom::TNode>::as_element

Memory usage balloons until the program exits indeed.

I don't expect a particular signature to show up. Thunderbird is doing a lot of stuff so the bottommost frame is basically "whatever it was doing at the time". The frames at the top might be more useful.

Flags: needinfo?(emilio)

I am not able to reproduce this on Mac. I haven't tried Windows. Also not able to find other version 111 or 112 reports of hang or memory in bugzilla.

Emilio, do you have any more data?
Thomas, can you reproduce on any or all of your OS?

Until we can reproduce or identify the cause let's reduce this to sev=3

Severity: S2 → S3
Flags: needinfo?(emilio)
Flags: needinfo?(bugzilla2007)
Summary: Switching to the unified folder inbox hangs → Switching to the unified folder inbox using folder mode settings hangs with high memory

Hi guys, first of all congratulations for Supernova: you are doing an excellent job! Many thanks!
I can confirm that, with a total of 270K emails, switching to the unified folder inbox, the program hangs for about 3 minutes.
Here with TB 111.0b1 (but also in Daily).

Aureliano, since you seem to be able to repro this but not hang your machine, is there any chance you could take a profile? For me since I removed my mail db I haven't seen this issue.

Flags: needinfo?(emilio)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #6)

Aureliano, since you seem to be able to repro this but not hang your machine, is there any chance you could take a profile? For me since I removed my mail db I haven't seen this issue.

I suggest reducing the sample rate when getting the profile, so it's not to big to upload.
https://support.mozilla.org/en-US/kb/profiling-thunderbird-performance

Flags: needinfo?(euryalus.0)

It might be helpful to determine why this fails for some users and not others.

Can anyone else reproduce?

Flags: needinfo?(thee.chicago.wolf)
Flags: needinfo?(soeren.hentzschel)
Flags: needinfo?(bugzilla2007)
Flags: needinfo?(acdp)

(In reply to Wayne Mery (:wsmwk) from comment #8)

It might be helpful to determine why this fails for some users and not others.

Can anyone else reproduce?

I tested with 111.0b3. After switching to Unified folder view, I didn't get a hang. Nothing in Error Console either. My profile is 81GB.

Flags: needinfo?(thee.chicago.wolf)

On Windows, on a instance with only ONE account, I see a definitely delay of the message list when clicking on most unified folders. But nothing more

I can't reproduce on a MacBook Pro from 2021 with M1 Pro, macOS 13.2.1 and seven mail accounts in my Thunderbird. I have no idea how many e-mails there are in total, but I guess less than 10,000.

Flags: needinfo?(soeren.hentzschel)

Here my profiling result as permalink https://share.firefox.dev/3yiQwGT
I'm on TB 111.0b2 and now I have an hang time of about 80 seconds
I have 270,000 emails.

To be more precise, when I'm in Unified Folder mode, I have the same freeze when I move from one folder to another for example from inbox to sentbox.

Flags: needinfo?(euryalus.0)
Flags: needinfo?(acdp)
See Also: → 1821617

After switching to Unified, my TB hangs indefinitely (well, 10 mins at least); 100% of a cpu core, but no increase in RAM usage (2.5GB). The app becomes "not responding" and I have to Force Quit.

MacOS 13.2.1 — Daily 2023-03-09, 52GB profile, 300K messages.

Annoyingly, I now can't start TB up at all, since it now hangs at start. Anyone know how to switch back to All, from Unified, via adjusting prefs? I don't see a Unified in prefs.js.

Managed to recover it via a forced-downgrade to a pre-SN version; phew!

Thanks Aureliano!

(In reply to [:Aureliano Buendía] from comment #12)

Here my profiling result as permalink https://share.firefox.dev/3yiQwGT
I'm on TB 111.0b2 and now I have an hang time of about 80 seconds
I have 270,000 emails.

To be more precise, when I'm in Unified Folder mode, I have the same freeze when I move from one folder to another for example from inbox to sentbox.

The profile goes bad at morkTableMapIter::NextTable.
Yes, the screen shots in the profile suggest 75 seconds of yank!

Severity: S3 → S2
Flags: needinfo?(mkmelin+mozilla)
Priority: -- → P2

(In reply to [:Aureliano Buendía] from comment #12)

Here my profiling result as permalink https://share.firefox.dev/3yiQwGT
I'm on TB 111.0b2 and now I have an hang time of about 80 seconds
I have 270,000 emails.

To be more precise, when I'm in Unified Folder mode, I have the same freeze when I move from one folder to another for example from inbox to sentbox.

I would guess there's no improvement using 111.0b4 or 112.0b1?

Flags: needinfo?(euryalus.0)

(In reply to Arthur K. (he/him) from comment #16)

I would guess there's no improvement using 111.0b4 or 112.0b1?

With 112 it's better (about 20-30 seconds delay), however it remains practically unusable in a working environment

Flags: needinfo?(euryalus.0)

I was hoping you would answer :) "Better" is good to hear.

Can you get a new performance profile?

Hi Wayne I have no doubt it will get better and better...

Here my profiling result as permalink https://share.firefox.dev/3yPuxr4

(In reply to Wayne Mery (:wsmwk) from comment #15)

The profile goes bad at morkTableMapIter::NextTable.

Right, I think we have other bugs also arriving there. But I don't know why.

Flags: needinfo?(mkmelin+mozilla)

(In reply to [:Aureliano Buendía] from comment #17)

(In reply to Arthur K. (he/him) from comment #16)

I would guess there's no improvement using 111.0b4 or 112.0b1?

With 112 it's better (about 20-30 seconds delay), however it remains practically unusable in a working environment

Thanks for the reply. 20-30 seconds is far better than 80 seconds but surely not where it needs to be. All the side effects from work on Supernova is going to take some time to shake out. Still looking like it's tripping over at the morkTableMapIter::NextTable as Wayne stated in comment 15.

How is this with 112.0b3 ?

(In reply to Wayne Mery (:wsmwk) from comment #22)

How is this with 112.0b3 ?

same behavior as the previous version

OS: Unspecified → All
Priority: P2 → P3

How is it now, after b4, b5, b6 ? (there was at least one important uplift)

Flags: needinfo?(euryalus.0)
Flags: needinfo?(emilio)
Summary: Switching to the unified folder inbox using folder mode settings hangs with high memory → Switching to the unified folder inbox using folder mode settings hangs with high memory, high activity in morkTableMapIter::NextTable

I use daily, without issue since I blew up my local mail.

Flags: needinfo?(emilio)

Slightly improved performance, but problem still exists:

  • Pass from All Folders a unified folder of about 14"-15";
  • Go from Inbox (270k mail) to Sentbox (100K mail) about 3"-5"
  • Return from Sentbox to Inbox about 12"-13"

Here my profiling result as permalink https://share.firefox.dev/3KBGQhG in TB 112.0b6 (64bit) on Windows 11

Flags: needinfo?(euryalus.0)

(In reply to [:Aureliano Buendía] from comment #26)

Here my profiling result as permalink https://share.firefox.dev/3KBGQhG in TB 112.0b6 (64bit) on Windows 11

Flags: needinfo?(mkmelin+mozilla)

(Nothing to add, tripping over morkTableMapIter::NextTable as previously noticed.)

Flags: needinfo?(mkmelin+mozilla)

(In reply to [:Aureliano Buendía] from comment #26)

Slightly improved performance, but problem still exists:

  • Pass from All Folders a unified folder of about 14"-15";
  • Go from Inbox (270k mail) to Sentbox (100K mail) about 3"-5"
  • Return from Sentbox to Inbox about 12"-13"

Here my profiling result as permalink https://share.firefox.dev/3KBGQhG in TB 112.0b6 (64bit) on Windows 11

Any improvement with 113.0b1?

(In reply to Arthur K. (he/him) from comment #29)

Any improvement with 113.0b1?

The behavior is worse than the previous version: to switch from one mode to another takes more than 180" (previously, they were "only" 14"-15").
Here my profiling result as permalink https://share.firefox.dev/41dMBaG

Thanks!

Now we have a new problem on top of the other one. I think I know what might be causing it, but not why that would start happening now. I'll deal with it in a new bug.

See Also: → 1827755

(In reply to [:Aureliano Buendía] from comment #30)

The behavior is worse than the previous version: to switch from one mode to another takes more than 180" (previously, they were "only" 14"-15").
Here my profiling result as permalink https://share.firefox.dev/41dMBaG

Does this additional wait happen if you add the Unified mode without removing the All mode? From the profile it looks like we're trying to select a folder over and over again, possibly because the number of rows in the folder tree drops to zero.

Duplicate of this bug: 1821617
Attached image both-mode-are-on.png

(In reply to Geoff Lankow (:darktrojan) from comment #32)

Does this additional wait happen if you add the Unified mode without removing the All mode? From the profile it looks like we're trying to select a folder over and over again, possibly because the number of rows in the folder tree drops to zero.

When I click on 'Unified Folders', 'All Folders' remains flagged on. I click again immediately to remove the 'All Folders' check, which is removed after about 100". In theory it seems that by design a user can choose to see multiple modes at the same time: for example when I return to 'All Folders' mode, if I don't remove the flag 'Unified Folders' I see both modes.

That's not what I asked. If you don't click to remove the check on All Folders, does the extra delay happen or not?

I try to be clearer:

  • I open TB with only 'All FOlders' mode on;
  • I click on 'Unified Folders' mode: TB does not hangs and currently 'All Folders' and 'Unified Folders' are both active and visible;
  • scroll down to the 'Unified Folders' section;
  • click on the Inbox folder ('Unified Folders') and TB hangs as in the previous scenario.

I attach the result of the profiling as a permalink https://share.firefox.dev/3oaqeon

I'm seeing the same hang/slowness with 113.0b2 on Windows 11 Pro, 64-bit. I believe the hang appears to happen when unchecking "All folders" because that forces the Unified Inbox to become selected - but I get the same hack if I leave "All Folders" enabled and just switch to the Unified Folders Inbox. I have the same behavior on restart - Tb hands indefinitely until I reset in Safe Mode back to All Folders view.

I tried minidumping but didn't see anything obvious (except most time spent in IO as per Visual Studio).
Deleting global messages db didn't help, nor did deleting the smart mailboxes config (both suggestions I found for related issues).

I think I've figured out what's going on, and it's ugly. But it should be fixable.

Assignee: nobody → geoff
Status: NEW → ASSIGNED

This functionality was added to the base nsMsgDBView, but not these subclasses.

See Also: → 1827003
Target Milestone: --- → 114 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/d0c328a2cc33
Wrap loading of virtual folder views in batch notifications. r=leftmostcat

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Attachment #9329406 - Flags: approval-comm-beta?

Comment on attachment 9329406 [details]
Bug 1817367 - Wrap loading of virtual folder views in batch notifications. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9329406 - Flags: approval-comm-beta? → approval-comm-beta+
Whiteboard: [Supernova] → [Supernova3p]

In TB 113.0b4 issue in comment 30 now is fixed, but performance has returned to roughly what it was at the time of comment 26: about 10" delay with the steps referred to in comment 36. Should be open a new issue?

I have opened a new issue Bug #1830145 that you can reproduce with the same STRs in https://bugzilla.mozilla.org/show_bug.cgi?id=1817367#c36
with the exception that in Unified Folders mode, View-Threads-All must be set.

See Also: → 1830145
Duplicate of this bug: 1828914
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: