New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 696844 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

memory coordinator v0: update internal design of MemoryCoordinatorImpl

Project Member Reported by bashi@chromium.org, Feb 28 2017

Issue description

Project Member

Comment 1 by bugdroid1@chromium.org, Feb 28 2017

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

commit 00e91606d2a09284064419ce93c34b6efe5e4c66
Author: bashi <bashi@chromium.org>
Date: Tue Feb 28 04:25:15 2017

Rename memory coordinator's variation parameters part 1

I've started replacing the global memory state with an internal state of
memory coordinator (see [1] for details). There are variation parameters
which are associated with the global memory state calculation and we
should rename them. This CL is a preparation for the renaming;
tentatively get variation parameters from both before- and after-
parameters. After we change server side, we can actually rename
parameters.

[1]
https://docs.google.com/document/d/1XZFywVyc60mJOP76BO--AXlhrgi73noIiD5dhS6LXzA/edit#heading=h.u80pgevn2w7e

BUG=696844

Review-Url: https://codereview.chromium.org/2717953004
Cr-Commit-Position: refs/heads/master@{#453492}

[modify] https://crrev.com/00e91606d2a09284064419ce93c34b6efe5e4c66/content/browser/memory/memory_state_updater.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Feb 28 2017

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

commit 2451a9a11f87ce84cd6f280984b05251d7a2093d
Author: bashi <bashi@chromium.org>
Date: Tue Feb 28 05:16:38 2017

Deprecate memory coordinator v0 related histograms

We've been running an experiment for memory coordinator. Based on the
results from the experiment, I've started changing internal design
of memory coordinator and most histograms related to memory coordinator
won't make sense anymore.

BUG=696844

Review-Url: https://codereview.chromium.org/2719283002
Cr-Commit-Position: refs/heads/master@{#453512}

[modify] https://crrev.com/2451a9a11f87ce84cd6f280984b05251d7a2093d/content/browser/memory/memory_coordinator_impl.cc
[modify] https://crrev.com/2451a9a11f87ce84cd6f280984b05251d7a2093d/content/browser/memory/memory_coordinator_impl.h
[modify] https://crrev.com/2451a9a11f87ce84cd6f280984b05251d7a2093d/content/browser/memory/memory_monitor_android.cc
[modify] https://crrev.com/2451a9a11f87ce84cd6f280984b05251d7a2093d/tools/metrics/histograms/histograms.xml

Project Member

Comment 3 by bugdroid1@chromium.org, Mar 3 2017

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

commit 810232f5fc6a9c5f26ded564bc4546ce04362a78
Author: bashi <bashi@chromium.org>
Date: Fri Mar 03 04:38:02 2017

Drop the global memory state from memory coordinator

Instaed of the global memory state, introduce a new internal
state for memory coordinator called MemoryCondition. See [1]
for the motivation.

[1] https://docs.google.com/document/d/1XZFywVyc60mJOP76BO--AXlhrgi73noIiD5dhS6LXzA/edit#

BUG=696844

Review-Url: https://codereview.chromium.org/2718963002
Cr-Commit-Position: refs/heads/master@{#454512}

[modify] https://crrev.com/810232f5fc6a9c5f26ded564bc4546ce04362a78/content/browser/BUILD.gn
[add] https://crrev.com/810232f5fc6a9c5f26ded564bc4546ce04362a78/content/browser/memory/memory_condition_observer.cc
[add] https://crrev.com/810232f5fc6a9c5f26ded564bc4546ce04362a78/content/browser/memory/memory_condition_observer.h
[modify] https://crrev.com/810232f5fc6a9c5f26ded564bc4546ce04362a78/content/browser/memory/memory_coordinator_impl.cc
[modify] https://crrev.com/810232f5fc6a9c5f26ded564bc4546ce04362a78/content/browser/memory/memory_coordinator_impl.h
[modify] https://crrev.com/810232f5fc6a9c5f26ded564bc4546ce04362a78/content/browser/memory/memory_coordinator_impl_unittest.cc
[modify] https://crrev.com/810232f5fc6a9c5f26ded564bc4546ce04362a78/content/browser/memory/memory_monitor_android.cc
[delete] https://crrev.com/c8c1429588c2190eb5562d57c0e0ba3b4cbe6f8d/content/browser/memory/memory_state_updater.cc
[delete] https://crrev.com/c8c1429588c2190eb5562d57c0e0ba3b4cbe6f8d/content/browser/memory/memory_state_updater.h

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 6 2017

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

commit 1504af7fee3fcc0532208cfe3042571d89d131ed
Author: bashi <bashi@chromium.org>
Date: Mon Mar 06 02:50:39 2017

memory coordinator: Remove obsoleted variation parameters

Sufficient time passed since the server side configuration was changed.

BUG=696844

Review-Url: https://codereview.chromium.org/2731233002
Cr-Commit-Position: refs/heads/master@{#454815}

[modify] https://crrev.com/1504af7fee3fcc0532208cfe3042571d89d131ed/content/browser/memory/memory_condition_observer.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Mar 6 2017

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

commit 9a71b6540c7dce7068c4abe0317e740f504986fc
Author: bashi <bashi@chromium.org>
Date: Mon Mar 06 04:32:18 2017

Add MemoryCoordinatorImpl::OnChildVisibilityChanged()

This is a follow-up CL of crrev.com/2718963002. Use the same logic for
child process state initialization and visibility changes.

BUG=696844

Review-Url: https://codereview.chromium.org/2735633002
Cr-Commit-Position: refs/heads/master@{#454825}

[modify] https://crrev.com/9a71b6540c7dce7068c4abe0317e740f504986fc/content/browser/memory/memory_coordinator_impl.cc
[modify] https://crrev.com/9a71b6540c7dce7068c4abe0317e740f504986fc/content/browser/memory/memory_coordinator_impl.h
[modify] https://crrev.com/9a71b6540c7dce7068c4abe0317e740f504986fc/content/browser/memory/memory_coordinator_impl_unittest.cc

Cc: shrike@chromium.org
Hello bashi@,

Wondering about the patch in c#3 - does it just rename a bunch of items or does it change how the memory coordinator works/behaves? I'm looking at a memory pressure regression on the Mac ( Issue 699631 ) and that cl is listed in the change log.

Comment 8 by bashi@chromium.org, Mar 10 2017

Hi shrike@,

The main purpose of the CL was just renaming and the changes in behavior is very minor. I'm planning to change the behavior in the near future though.

That's said, I don't think the CL caused the regression on mac because we don't enable memory coordinator on mac even in experiments.
Project Member

Comment 9 by bugdroid1@chromium.org, Mar 10 2017

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

commit a2181336154c12cb49601f515cb5dace1b06b1f2
Author: bashi <bashi@chromium.org>
Date: Fri Mar 10 03:00:46 2017

Update MemoryMonitorChromeOS

Current guidelines for defining critical memory state is swapping will
occur in that situation. Update MemoryMonitorChromeOS to align the
guidelines.

- Use |available| field of base::SystemMemoryInfoKB if the OS supports it
- Don't count SwapFree as free available memory

BUG=696844

Review-Url: https://codereview.chromium.org/2731273003
Cr-Commit-Position: refs/heads/master@{#455970}

[modify] https://crrev.com/a2181336154c12cb49601f515cb5dace1b06b1f2/content/browser/memory/memory_monitor_chromeos.cc
[modify] https://crrev.com/a2181336154c12cb49601f515cb5dace1b06b1f2/content/browser/memory/memory_monitor_chromeos_unittest.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Mar 21 2017

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

commit ff04f9a412991a4d83c2bf5422c6489d7ed086e1
Author: bashi <bashi@chromium.org>
Date: Tue Mar 21 04:33:37 2017

memory coordinator: Delay setting browsers memory state if needed

Before this CL memory coordinator ignored browser's memory state
change until |minimum_state_transition_period_| is passed. This
behavior caused inconsistency between the current memory pressure
and the browsers state. For example, the browser's memory state
could remain THROTTLED state when memory condition is quickly changed
from CRITICAL to NORMAL. The browser's state should be changed to
NORMAL after |minimum_state_transition_period_| is passed.

BUG=696844

Review-Url: https://codereview.chromium.org/2757653003
Cr-Commit-Position: refs/heads/master@{#458309}

[modify] https://crrev.com/ff04f9a412991a4d83c2bf5422c6489d7ed086e1/content/browser/memory/memory_coordinator_impl.cc
[modify] https://crrev.com/ff04f9a412991a4d83c2bf5422c6489d7ed086e1/content/browser/memory/memory_coordinator_impl.h
[modify] https://crrev.com/ff04f9a412991a4d83c2bf5422c6489d7ed086e1/content/browser/memory/memory_coordinator_impl_unittest.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Mar 30 2017

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

commit b9058f285cf483b7c49fe46e554f55f54ffeb956
Author: bashi <bashi@chromium.org>
Date: Thu Mar 30 01:55:24 2017

memory coordinator: Purge memory under memory pressure

- On WARNING condition, request a backgrounded child process to purge memory
- On CRITICAL condition, try to discard a tab first. If it failed, try to
  purge memory from all child processes. It it failed, try to purge memory
  from the browser process
- Use somewhat conservative heuristics for purging
  - Browser: suppress purging for 2 mins after a purge
  - Renderer: after purging, suppress the next purging until the renderer
    goes foreground -> background then remains backgrounded for 30 secs

BUG=696844

Review-Url: https://codereview.chromium.org/2763933002
Cr-Commit-Position: refs/heads/master@{#460622}

[modify] https://crrev.com/b9058f285cf483b7c49fe46e554f55f54ffeb956/content/browser/memory/memory_condition_observer.cc
[modify] https://crrev.com/b9058f285cf483b7c49fe46e554f55f54ffeb956/content/browser/memory/memory_coordinator_impl.cc
[modify] https://crrev.com/b9058f285cf483b7c49fe46e554f55f54ffeb956/content/browser/memory/memory_coordinator_impl.h
[modify] https://crrev.com/b9058f285cf483b7c49fe46e554f55f54ffeb956/content/browser/memory/memory_coordinator_impl_unittest.cc
[modify] https://crrev.com/b9058f285cf483b7c49fe46e554f55f54ffeb956/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/b9058f285cf483b7c49fe46e554f55f54ffeb956/content/renderer/render_thread_impl.h
[modify] https://crrev.com/b9058f285cf483b7c49fe46e554f55f54ffeb956/tools/metrics/histograms/histograms.xml

Project Member

Comment 13 by bugdroid1@chromium.org, Apr 20 2017

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

commit e475d97ed39fecfb67814dcf0607746f8aea1cb4
Author: bashi <bashi@chromium.org>
Date: Thu Apr 20 08:36:31 2017

memory_coordinator: Use TimeTicks to suppress memory condition update

Before this CL ForceSetMemoryCondition() was implemented by rescheduling
the task which updates memory condition. It resulted in not calling
UpdateConditionIfNeeded() until a given interval is passed. This is no
longer an expected behavior because UpdateConditionIfNeeded() does more
work than just updating condition. Instead of rescheduing the task, add a
TimeTicks to suppress memory condition update for a given interval.

BUG=696844

Review-Url: https://codereview.chromium.org/2832753002
Cr-Commit-Position: refs/heads/master@{#465951}

[modify] https://crrev.com/e475d97ed39fecfb67814dcf0607746f8aea1cb4/content/browser/memory/memory_coordinator_impl.cc
[modify] https://crrev.com/e475d97ed39fecfb67814dcf0607746f8aea1cb4/content/browser/memory/memory_coordinator_impl.h
[modify] https://crrev.com/e475d97ed39fecfb67814dcf0607746f8aea1cb4/content/browser/memory/memory_monitor_android.cc

Project Member

Comment 14 by bugdroid1@chromium.org, May 12 2017

Project Member

Comment 15 by bugdroid1@chromium.org, Jun 19 2017

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

commit b2bea37ff0b2955f79a8d88d87e61e6a82429255
Author: bashi <bashi@chromium.org>
Date: Mon Jun 19 01:40:17 2017

Remove MemoryCoordinator::CanSuspendRenderer()

We no longer have a plan to use this method. We can add it later if we
really need this.

BUG=696844

Review-Url: https://codereview.chromium.org/2941123004
Cr-Commit-Position: refs/heads/master@{#480329}

[modify] https://crrev.com/b2bea37ff0b2955f79a8d88d87e61e6a82429255/chrome/browser/memory/chrome_memory_coordinator_delegate.cc
[modify] https://crrev.com/b2bea37ff0b2955f79a8d88d87e61e6a82429255/chrome/browser/memory/chrome_memory_coordinator_delegate.h
[modify] https://crrev.com/b2bea37ff0b2955f79a8d88d87e61e6a82429255/content/browser/memory/memory_coordinator_impl.cc
[modify] https://crrev.com/b2bea37ff0b2955f79a8d88d87e61e6a82429255/content/browser/memory/memory_coordinator_impl.h
[modify] https://crrev.com/b2bea37ff0b2955f79a8d88d87e61e6a82429255/content/browser/memory/memory_coordinator_impl_browsertest.cc
[modify] https://crrev.com/b2bea37ff0b2955f79a8d88d87e61e6a82429255/content/browser/memory/memory_coordinator_impl_unittest.cc
[modify] https://crrev.com/b2bea37ff0b2955f79a8d88d87e61e6a82429255/content/browser/service_worker/service_worker_browsertest.cc
[modify] https://crrev.com/b2bea37ff0b2955f79a8d88d87e61e6a82429255/content/public/browser/memory_coordinator_delegate.h

Project Member

Comment 16 by bugdroid1@chromium.org, Jun 19 2017

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

commit 1960d03cec25ebdf6d8d14a06e2eeebf19debcc2
Author: bashi <bashi@chromium.org>
Date: Mon Jun 19 03:25:58 2017

Remove MemoryCondition::WARNING

It's not clear that having WARNING condition helps us to build a
reasonable policy to handle memory pressure. Just use a binary
(NORMAL and CRITICAL) until we really need it.

This CL also simplifies the heuristic to estimate memory pressure
to reduce complexity.

BUG=696844

Review-Url: https://codereview.chromium.org/2943603002
Cr-Commit-Position: refs/heads/master@{#480336}

[modify] https://crrev.com/1960d03cec25ebdf6d8d14a06e2eeebf19debcc2/content/browser/memory/memory_condition_observer.cc
[modify] https://crrev.com/1960d03cec25ebdf6d8d14a06e2eeebf19debcc2/content/browser/memory/memory_condition_observer.h
[modify] https://crrev.com/1960d03cec25ebdf6d8d14a06e2eeebf19debcc2/content/browser/memory/memory_coordinator_default_policy.cc
[modify] https://crrev.com/1960d03cec25ebdf6d8d14a06e2eeebf19debcc2/content/browser/memory/memory_coordinator_default_policy.h
[modify] https://crrev.com/1960d03cec25ebdf6d8d14a06e2eeebf19debcc2/content/browser/memory/memory_coordinator_impl.cc
[modify] https://crrev.com/1960d03cec25ebdf6d8d14a06e2eeebf19debcc2/content/browser/memory/memory_coordinator_impl.h
[modify] https://crrev.com/1960d03cec25ebdf6d8d14a06e2eeebf19debcc2/content/browser/memory/memory_coordinator_impl_unittest.cc
[modify] https://crrev.com/1960d03cec25ebdf6d8d14a06e2eeebf19debcc2/content/browser/memory/memory_monitor_android.cc

Project Member

Comment 18 by bugdroid1@chromium.org, Jun 22 2017

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

commit 85241f184bc209cc43e1552b2113806e9f3321a7
Author: bashi <bashi@chromium.org>
Date: Thu Jun 22 21:47:42 2017

Don't disable MemoryPressureListener when MemoryCoordinator is enabled

Memory coordinator is going to focus on how/when to request tab
discarding and won't replace existing MemoryPressureListeners except for
TabManager. We shouldn't disable MemoryPressureListeners.

BUG=696844

Review-Url: https://codereview.chromium.org/2943953002
Cr-Commit-Position: refs/heads/master@{#481674}

[modify] https://crrev.com/85241f184bc209cc43e1552b2113806e9f3321a7/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/85241f184bc209cc43e1552b2113806e9f3321a7/content/browser/browser_main_loop.cc
[modify] https://crrev.com/85241f184bc209cc43e1552b2113806e9f3321a7/content/browser/memory/memory_coordinator_impl.cc
[modify] https://crrev.com/85241f184bc209cc43e1552b2113806e9f3321a7/content/browser/memory/memory_coordinator_impl.h

Sign in to add a comment