New issue
Advanced search Search tips

Issue 877137 link

Starred by 8 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 6
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-09-10
OS: Mac
Pri: 1
Type: Bug



Sign in to add a comment

Chrome slows down system app switching over time

Project Member Reported by sdy@chromium.org, Aug 23

Issue description

Chrome Version: 70.0.3530.0
OS: macOS 10.13.6 (17G65)

What steps will reproduce the problem?
(1) Leave Chrome running for a while. Using Google services might help (see trace).
(2) Try switching apps and windows, even between non-Chrome apps.

What is the expected result?
Fast switching.

What happens instead?
It can take 1s+ to switch windows until Chrome is quit.

The trace seems to consistently include SafeBrowsing on the IO thread, FocusRing::Layout on the UI thread, and a hidden renderer (an accounts.google.com iframe or an extension) replying to Mojo IPCs that log "ReceiveBeginFrame" events in the trace.

I'm marking this M-70 because I think it appeared since then.

Relaunching makes the delay go away.
 
trace_trace_app_switch_delay_2.json.gz
808 KB Download
Owner: mark@chromium.org
Status: Assigned (was: Untriaged)
The tracing seem to have a BrowserCrApplication that is taking a long time. Could that be the cause? Assigning to mark@ who might know more about that.
Owner: ----
Status: Untriaged (was: Assigned)
Re. #1, I'm on the Mac team. The BrowserCrApplication::SendEvent item you're seeing is essentially just "the main thread is blocked". The things I mentioned in the description are, AFAICT, the candidates for what's blocking it.
I'm seeing this too and it's driving me nuts. :(

"""
    + !                         : 551 -[BrowserCrApplication sendEvent:]  (in Google Chrome Framework)  load address 0x109478000 + 0x1fff2f7  [crash_key.h:187]
    + !                         :   551 base::mac::CallWithEHFrame(void () block_pointer)  (in Google Chrome Framework)  load address 0x109478000 + 0x23f7b0a  []
    + !                         :     551 __34-[BrowserCrApplication sendEvent:]_block_invoke  (in Google Chrome Framework)  load address 0x109478000 + 0x1fff664  [chrome_browser_application_mac.mm:0]
    + !                         :       537 -[NSApplication(NSEvent) sendEvent:]  (in AppKit) + 2462  [0x7fff33862236]
    + !                         :       | 491 -[NSApplication _handleDeactivateEvent:]  (in AppKit) + 1134  [0x7fff334e7726]
    + !                         :       | + 478 -[NSWindow(NSFullScreen) _doUpdateTilingConstraintsImmediately]  (in AppKit) + 132  [0x7fff33c48fe2]
    + !                         :       | + ! 477 SLSPackagesSetWindowConstraints  (in SkyLight) + 236  [0x7fff578ccf6e]
    + !                         :       | + ! : 476 mach_msg  (in libsystem_kernel.dylib) + 60  [0x7fff5dab9724]
    + !                         :       | + ! : | 476 mach_msg_trap  (in libsystem_kernel.dylib) + 10  [0x7fff5daba20a]
"""

This seems like a recent development. Currently on 70.0.3532.0
chrome_cmd_tab_slow_sample.txt
359 KB View Download
trace_with_heap_dump.json.gz
642 KB Download
Screen Shot 2018-08-27 at 11.42.53 AM.png
414 KB View Download
Looks like a large CG leak related to CATransaction handlers
Issue 877926 has been merged into this issue.
Copying some context from crbug.com/877926
- The hang seemed to be tied to 100% CPU in WindowServer
- It didn’t go away for me after restart (I upgraded Canary before reporting)
- It affected my work machine, but not my personal machine at the same version
Labels: Target-70
Owner: sdy@chromium.org
Status: Assigned (was: Untriaged)
Hm, this seems bad. sdy@, can you take a peek and try to fix for M70? Erik had a theory in #5 :)
Re. #7, does your corp MacBook Pro have a Touch Bar?
Yes, it does. My personal machine does not.
Cc: a...@chromium.org sdy@chromium.org pbomm...@chromium.org
 Issue 880580  has been merged into this issue.
Cc: -sdy@chromium.org -a...@chromium.org -pbomm...@chromium.org
Accidentally duped a bug into this one. Undoing.
Project Member

Comment 13 by bugdroid1@chromium.org, Sep 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/745395c5cd27b8921bc82f66691e7a9ddca07753

commit 745395c5cd27b8921bc82f66691e7a9ddca07753
Author: Sidney San Martín <sdy@chromium.org>
Date: Thu Sep 06 16:54:19 2018

Fix a leak in Touch Bar text suggestions.

Each leaked NSCandidateListTouchBarItem carried a CALayer and other
resources; holding on to them caused a major slowdown.

This change makes |-createCandidateListItem| return an autoreleased
NSCandidateListTouchBarItem instead of a retained one, and renames it to
|-makeCandidateListItem| to match the naming and ownership semantics of
|-makeTouchBar| (and be consistent with the create rule).

Bug:  877137 
Change-Id: Icfb335c341cb86e8691562ade4c222a59c990bf7
Reviewed-on: https://chromium-review.googlesource.com/1208428
Reviewed-by: Sarah Chan <spqchan@chromium.org>
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589195}
[modify] https://crrev.com/745395c5cd27b8921bc82f66691e7a9ddca07753/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h
[modify] https://crrev.com/745395c5cd27b8921bc82f66691e7a9ddca07753/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm
[modify] https://crrev.com/745395c5cd27b8921bc82f66691e7a9ddca07753/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_unittest.mm

NextAction: 2018-09-10
Status: Fixed (was: Assigned)
Let's check on Canary in a few days.
Labels: Merge-TBD
[Auto-generated comment by a script] We noticed that this issue is targeted for M-70; it appears the fix may have landed after branch point, meaning a merge might be required. Please confirm if a merge is required here - if so add Merge-Request-70 label, otherwise remove Merge-TBD label. Thanks.
The NextAction date has arrived: 2018-09-10
Labels: -Merge-TBD Merge-Request-70
Labels: -Merge-Request-70 Merge-Approved-70
Approved - 3538
Project Member

Comment 19 by bugdroid1@chromium.org, Sep 11

Labels: -merge-approved-70 merge-merged-3538
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6dc70f23f2d0b01ac7e04492c256c40f5cb5c2a6

commit 6dc70f23f2d0b01ac7e04492c256c40f5cb5c2a6
Author: Sidney San Martín <sdy@chromium.org>
Date: Tue Sep 11 19:37:09 2018

Fix a leak in Touch Bar text suggestions.

Each leaked NSCandidateListTouchBarItem carried a CALayer and other
resources; holding on to them caused a major slowdown.

This change makes |-createCandidateListItem| return an autoreleased
NSCandidateListTouchBarItem instead of a retained one, and renames it to
|-makeCandidateListItem| to match the naming and ownership semantics of
|-makeTouchBar| (and be consistent with the create rule).

Bug:  877137 
Change-Id: Icfb335c341cb86e8691562ade4c222a59c990bf7
Reviewed-on: https://chromium-review.googlesource.com/1208428
Reviewed-by: Sarah Chan <spqchan@chromium.org>
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#589195}(cherry picked from commit 745395c5cd27b8921bc82f66691e7a9ddca07753)
Reviewed-on: https://chromium-review.googlesource.com/1220128
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/branch-heads/3538@{#284}
Cr-Branched-From: 79f7c91a2b2a2932cd447fa6f865cb6662fa8fa6-refs/heads/master@{#587811}
[modify] https://crrev.com/6dc70f23f2d0b01ac7e04492c256c40f5cb5c2a6/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.h
[modify] https://crrev.com/6dc70f23f2d0b01ac7e04492c256c40f5cb5c2a6/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller.mm
[modify] https://crrev.com/6dc70f23f2d0b01ac7e04492c256c40f5cb5c2a6/chrome/browser/ui/cocoa/touchbar/text_suggestions_touch_bar_controller_unittest.mm

Sign in to add a comment