Closed Bug 2086594 Opened 17 days ago Closed 10 days ago

Non-permanent hang on macOS due to excessive amount of bookmarks

Categories

(Firefox :: Bookmarks & History, defect)

Firefox 161
Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: allan, Assigned: spohl)

References

Details

Attachments

(1 external file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:159.0) Gecko/20100101 Firefox/159.0

Steps to reproduce

This is essentially a duplicate of bug 2002102, which I have to create as I'm no longer able to comment on the page for the original bug report due to its closure.

I just updated to Nightly 161.0a1 (2026-10-28) a few minutes ago, and with the excessive amount of bookmarks that I'd imported from my regular Firefox instance, hitting command-spacebar caused the exact same non-permanent hang to occur. It was a clean install (first time ever installing Nightly), with no changes to the instance besides the importation of bookmarks. Command-spacebar caused no issues when the bookmarks weren't present.

Actual results

Non-permanent hang.

Expected results

No hang.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Cocoa' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core
Component: Widget: Cocoa → Bookmarks & History
OS: Unspecified → macOS
Product: Core → Firefox
Assignee: nobody → spohl.mozilla.bugs
Severity: -- → S3
Status: UNCONFIRMED → ASSIGNED
Depends on: 2002102
Ever confirmed: true

Limit the menu items we create because nested folder results do not apply maxResults.

(In reply to Stephen A Pohl [:spohl] from comment #2)

Created attachment 9670955 [details]

I updated Nightly again, and of course the same non-permanent hang occurred when hitting command-space bar. I finally took another profile (as Marco asked way back when), wherein trying to click on the the Profile button to stop the capture caused an even longer hang and made it really hard to simply stop the capture. Although I saved that profile, I captured another one where I instead used the keyboard shortcut to stop the capture, which resulted in a much shorter secondary non-permanent hang.

Anyway, should I send these profiles on through? And if so, how so?

Status: ASSIGNED → RESOLVED
Closed: 10 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch
QA Whiteboard: [qa-triage-done-c162/b161]

I hate to say it, but this doesn't actually appear to have been fixed. At least not on my end, and not in Nightly 162.0a1 (2026-11-09), which I updated and tested out just a few minutes before writing this comment.

Again, if anybody would like a Profile capture (from a regular release Firefox instance, or a Nightly instance -- or both) I'd be happy to send one or more through.

And just to be clear, the only thing I've done to this Nightly instance, which was the first time I'd ever installed Nightly, was import my bookmarks from my regular Firefox instance. No extensions, no customizations of any sort.

(In reply to Strømfeldt from comment #6)

I hate to say it, but this doesn't actually appear to have been fixed. At least not on my end, and not in Nightly 162.0a1 (2026-11-09), which I updated and tested out just a few minutes before writing this comment.

Again, if anybody would like a Profile capture (from a regular release Firefox instance, or a Nightly instance -- or both) I'd be happy to send one or more through.

And just to be clear, the only thing I've done to this Nightly instance, which was the first time I'd ever installed Nightly, was import my bookmarks from my regular Firefox instance. No extensions, no customizations of any sort.

Yes, a profile would be very helpful. The patches so far limit the number of entries in each menu, but not the total across all folders, so a large collection with many folders can most likely still cause this.

Could you capture a new profile with Nightly 162 as follows?

  1. Open about:profiling and click "Enable Profiler Menu Button", if it isn't enabled already.
  2. Press Cmd+Shift+1 to start recording.
  3. Press Cmd+Space, wait until Firefox responds again, then close Spotlight.
  4. Press Cmd+Shift+2 to capture. Using the keyboard shortcut instead of the toolbar button avoids the second hang you saw.
  5. In the new tab, click "Upload Local Profile" and paste the https://share.firefox.dev/... link here.

Could you also let us know roughly how many bookmarks and folders you have, and whether "Other Bookmarks" contains any entries that open history, downloads or tags?

After that, could you check if this makes a difference?

  1. Open about:config and set browser.places.nativeMenu.maxFolderResults to 50.
  2. Restart Firefox and press Cmd+Space again.

Afterwards, you can restore the default by clicking the reset button next to browser.places.nativeMenu.maxFolderResults in about:config.

Flags: needinfo?(allan)

Alright, here's the link to the profile:

https://bugzilla.mozilla.org/show_bug.cgi?id=2086594

In terms of bookmarks, I've got in the range of 100,000 (for research and the like), collected for more than a decade now. In terms of folders, definitely in the hundreds, probably over 1,000 (possibly in the thousands, I don't know). My "Other Bookmarks" folder is empty.

I tried out the browser.places.nativeMenu.maxFolderResults suggestion, and yes, it did in fact make a big difference. Rather than hang for a minute or so (and repeatedly drop in and out of hang-mode after the first 30 seconds or so), it hung for less than 10 seconds, zero "after shocks". Having mentioned that, I may have missed the "after shocks" in the profile I captured, and can send another more fuller one if you'd like.

p.s. If that's a template you copy/pasted from, I think #2 and #4 should be Ctrl+Shift, not Cmd+Shift

Flags: needinfo?(allan)

You're right, it's Ctrl+Shift+1 and Ctrl+Shift+2, sorry about that.

The link in your comment points back to this bug rather than to the profile. Could you paste the https://share.firefox.dev/... link instead? It's shown after you click "Upload" in the profile tab. A fuller profile that includes the "after shocks" would be great too, with the default value of browser.places.nativeMenu.maxFolderResults restored:

  1. Press Ctrl+Shift+1 to start recording.
  2. Press Cmd+Space, close Spotlight, and wait until Firefox has stopped hanging completely, including the "after shocks".
  3. Press Ctrl+Shift+2 to capture, then upload the profile and paste the link here.

The difference you saw with browser.places.nativeMenu.maxFolderResults set to 50 is very helpful. It looks like the total number of menu items across all folders is what we still need to limit.

Flags: needinfo?(allan)

Ah crap, sorry about that, the link wasn't the most recent one in Pastebot, and seeing Mozilla in the link I assumed it was the right one. Here's the proper link:

https://share.firefox.dev/4flZ7hD

In terms of the another capture with all the "after shocks", upon reopening Nightly a popup offered to update, which I did. Unfortunately Nightly wouldn't reopen after the update, nor after a re-install. I imagine this is somewhat "routine" and somebody's already on it, but after discovering the release archive server I deduced that the .dmg from this directory won't actually start up (the icon in the dock disappears before the app opens), while the .dmg from this directory does open after installing.

Anyway, here's another capture (from that newly-installed instance that actually opens):

  • For the first 30 seconds I had the spinning beach ball
  • For the next 60 seconds the spinning beach ball had disappeared, but upon scrolling up and down (on the new tab page) things repeatedly froze and unfroze and refroze and so on (the "after shocks")
  • For the next 15 seconds things fully froze with the spinning beach ball
  • For the next 15 seconds I once again had the freezing/unfreezing while scrolling up and down (no spinning beach ball)

After all that, about two minutes, everything returned back to normal. Here's the new profile:

https://share.firefox.dev/4k1KOCe

Flags: needinfo?(allan)

Thanks a lot for letting us know that Nightly no longer started after the update. That was a build problem that affected macOS 27, and it has since been fixed in bug 2091237. The next Nightly should start normally again, and you should be able to update to it from the build you installed from the DMG.

Thanks also for the profiles, they're very helpful. In both of them, most of the time appears to go into loading and drawing the icons of the bookmarks in the menu bar, even though the menus aren't actually shown on screen when you press Cmd+Space. I'm looking into ways to avoid that work, and I'll most likely file a new bug to track what's left here, since the patch on this bug has already landed.

See Also: → 2091501

(In reply to Stephen A Pohl [:spohl] from comment #11)

Thanks also for the profiles, they're very helpful. In both of them, most of the time appears to go into loading and drawing the icons of the bookmarks in the menu bar, even though the menus aren't actually shown on screen when you press Cmd+Space. I'm looking into ways to avoid that work, and I'll most likely file a new bug to track what's left here, since the patch on this bug has already landed.

I have filed bug 2091501 and believe to have a fix for this. I'll be posting a try build there, and ideally you could confirm that this fixes the remaining issue for you. Further updates will happen in bug 2091501. Thanks again for all your help here!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: