Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Issue 15650016: [Not for review] Discardable memory emulation (Closed)

Created:
7 years, 6 months ago by Ian Vollick
Modified:
7 years, 6 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, jam, gavinp+memory_chromium.org, jonathan.backer, ajuma
Visibility:
Public.

Description

Add discardable memory emulation for non-android non-mac platforms Installs a very basic discardable memory emulator. It purges only when all render widgets for the process are hidden, and when it purges, it purges every unlocked discardable. No attempt at a MRU or max cache size is attempted. BUG=237681

Patch Set 1 : . #

Total comments: 12

Patch Set 2 : . #

Total comments: 5

Patch Set 3 : . #

Patch Set 4 : . #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+340 lines, -65 lines) Patch
M base/base.gypi View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M base/containers/mru_cache.h View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M base/memory/discardable_memory.h View 1 2 3 4 chunks +25 lines, -3 lines 3 comments Download
M base/memory/discardable_memory.cc View 1 2 3 2 chunks +0 lines, -40 lines 0 comments Download
M base/memory/discardable_memory_android.cc View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download
A base/memory/discardable_memory_emulated.cc View 1 2 3 1 chunk +213 lines, -0 lines 11 comments Download
M base/memory/discardable_memory_mac.cc View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download
M base/memory/discardable_memory_unittest.cc View 1 2 3 3 chunks +2 lines, -10 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A content/renderer/render_process_visibility_manager.h View 1 2 3 1 chunk +32 lines, -0 lines 0 comments Download
A content/renderer/render_process_visibility_manager.cc View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 chunks +15 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M webkit/glue/webkitplatformsupport_impl.cc View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
Ian Vollick
Nat, when you have a sec, can you please take a look at this first ...
7 years, 6 months ago (2013-05-28 14:59:38 UTC) #1
Ian Vollick
On 2013/05/28 14:59:38, vollick wrote: > Nat, when you have a sec, can you please ...
7 years, 6 months ago (2013-05-29 13:49:29 UTC) #2
nduca
Hmm, multiple render threads?
7 years, 6 months ago (2013-05-29 13:50:47 UTC) #3
nduca
https://codereview.chromium.org/15650016/diff/2001/base/memory/discardable_memory.h File base/memory/discardable_memory.h (right): https://codereview.chromium.org/15650016/diff/2001/base/memory/discardable_memory.h#newcode20 base/memory/discardable_memory.h:20: #if !defined(OS_ANDROID) && !defined(OS_MACOSX) so, on windows 8, we ...
7 years, 6 months ago (2013-05-29 13:57:00 UTC) #4
jonathan.backer
https://codereview.chromium.org/15650016/diff/2001/base/memory/discardable_memory.cc File base/memory/discardable_memory.cc (right): https://codereview.chromium.org/15650016/diff/2001/base/memory/discardable_memory.cc#newcode31 base/memory/discardable_memory.cc:31: static DiscardableMemoryProvider* s_provider = NULL; Who owns the s_provider? ...
7 years, 6 months ago (2013-05-29 14:02:53 UTC) #5
Ian Vollick
Nat, all platforms now use a provider. PTAL! https://codereview.chromium.org/15650016/diff/2001/base/memory/discardable_memory.cc File base/memory/discardable_memory.cc (right): https://codereview.chromium.org/15650016/diff/2001/base/memory/discardable_memory.cc#newcode31 base/memory/discardable_memory.cc:31: static ...
7 years, 6 months ago (2013-06-06 00:21:46 UTC) #6
nduca
+qinmin who added some of this. Min, who of the base/ owners should we get ...
7 years, 6 months ago (2013-06-07 04:50:07 UTC) #7
nduca
This looks really solid. Before we add more folks, lets make this into a patch ...
7 years, 6 months ago (2013-06-07 04:51:40 UTC) #8
nduca
https://codereview.chromium.org/15650016/diff/19001/webkit/glue/webkitplatformsupport_impl.cc File webkit/glue/webkitplatformsupport_impl.cc (right): https://codereview.chromium.org/15650016/diff/19001/webkit/glue/webkitplatformsupport_impl.cc#newcode993 webkit/glue/webkitplatformsupport_impl.cc:993: if (!base::DiscardableMemoryProvider::GetInstance()) lets seal this though behind base::DiscardableMemory::Supported. It'd ...
7 years, 6 months ago (2013-06-07 04:52:18 UTC) #9
qinmin
+willchan
7 years, 6 months ago (2013-06-07 04:56:14 UTC) #10
qinmin
7 years, 6 months ago (2013-06-07 05:03:49 UTC) #11
Avi (use Gerrit)
Looking at the notes on the original implementation of DiscardableMemory (https://code.google.com/p/chromium/issues/detail?id=169597), it was cpu@ who ...
7 years, 6 months ago (2013-06-07 14:35:28 UTC) #12
Avi (use Gerrit)
I'm OK with the interfacing of DiscardableMemory. I'm less ok with the SetInstance deal. Have ...
7 years, 6 months ago (2013-06-07 14:46:53 UTC) #13
Avi (use Gerrit)
On 2013/06/07 14:46:53, Avi wrote: > I'm less ok with the > SetInstance deal. Have ...
7 years, 6 months ago (2013-06-07 15:04:18 UTC) #14
cpu_(ooo_6.6-7.5)
As is this emulation is like a weird cache. If you want a true emulation ...
7 years, 6 months ago (2013-06-07 17:57:41 UTC) #15
nduca
Sorry Avi, I've got ti disagree with you rather strongly.
7 years, 6 months ago (2013-06-07 18:16:59 UTC) #16
nduca
Ah shit, wrong button. So there is a ton of a discardable memory primitive. But, ...
7 years, 6 months ago (2013-06-07 18:23:13 UTC) #17
Avi (use Gerrit)
On 2013/06/07 18:23:13, nduca wrote: > Sorry Avi, I've got ti disagree with you rather ...
7 years, 6 months ago (2013-06-07 18:35:50 UTC) #18
cpu_(ooo_6.6-7.5)
>> the intent here is to start with simple emulation Like I said there is ...
7 years, 6 months ago (2013-06-07 21:53:38 UTC) #19
cpu_(ooo_6.6-7.5)
>> therwise you can have a tagging system with manual purging. I am proposing a ...
7 years, 6 months ago (2013-06-07 21:55:45 UTC) #20
Avi (use Gerrit)
On 2013/06/07 21:55:45, cpu wrote: > >> therwise you can have a tagging system with ...
7 years, 6 months ago (2013-06-07 22:33:07 UTC) #21
cpu_(ooo_6.6-7.5)
On 2013/06/07 22:33:07, Avi wrote: > On 2013/06/07 21:55:45, cpu wrote: > > >> therwise ...
7 years, 6 months ago (2013-06-08 02:14:14 UTC) #22
Avi (use Gerrit)
On 2013/06/08 02:14:14, cpu wrote: > On 2013/06/07 22:33:07, Avi wrote: > > On 2013/06/07 ...
7 years, 6 months ago (2013-06-08 02:15:37 UTC) #23
willchan no longer on Chromium
I haven't read this yet. Has the dust settled? What's the key disagreement, if any? ...
7 years, 6 months ago (2013-06-10 16:24:12 UTC) #24
Ian Vollick
On 2013/06/10 16:24:12, willchan wrote: > I haven't read this yet. Has the dust settled? ...
7 years, 6 months ago (2013-06-10 17:34:50 UTC) #25
Avi (use Gerrit)
On 2013/06/10 17:34:50, vollick wrote: > 1. The ability to install a static discardable memory ...
7 years, 6 months ago (2013-06-11 15:47:14 UTC) #26
ajuma
On 2013/06/11 15:47:14, Avi wrote: > On 2013/06/10 17:34:50, vollick wrote: > > 1. The ...
7 years, 6 months ago (2013-06-11 21:24:47 UTC) #27
Avi (use Gerrit)
On 2013/06/11 21:24:47, ajuma wrote: > On 2013/06/11 15:47:14, Avi wrote: > > On 2013/06/10 ...
7 years, 6 months ago (2013-06-11 21:27:19 UTC) #28
Ian Vollick
> How about moving the implementation into base/ (minus the parts that >> depend on ...
7 years, 6 months ago (2013-06-11 23:36:33 UTC) #29
Ian Vollick
On 2013/06/11 23:36:33, vollick wrote: > > How about moving the implementation into base/ (minus ...
7 years, 6 months ago (2013-06-12 12:21:10 UTC) #30
Avi (use Gerrit)
https://codereview.chromium.org/15650016/diff/53001/base/memory/discardable_memory.h File base/memory/discardable_memory.h (right): https://codereview.chromium.org/15650016/diff/53001/base/memory/discardable_memory.h#newcode26 base/memory/discardable_memory.h:26: class DiscardableMemoryProvider; Why is this class forward declared here? ...
7 years, 6 months ago (2013-06-12 14:56:48 UTC) #31
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/15650016/diff/53001/base/memory/discardable_memory_emulated.cc File base/memory/discardable_memory_emulated.cc (right): https://codereview.chromium.org/15650016/diff/53001/base/memory/discardable_memory_emulated.cc#newcode132 base/memory/discardable_memory_emulated.cc:132: if (bytes_allocated_ < kCacheLimitPurgeBound) I was expecting freeing N ...
7 years, 6 months ago (2013-06-13 20:16:06 UTC) #32
avi_google.com
7 years, 6 months ago (2013-06-14 11:09:33 UTC) #33
https://codereview.chromium.org/15650016/diff/53001/base/memory/discardable_m...
File base/memory/discardable_memory.h (right):

https://codereview.chromium.org/15650016/diff/53001/base/memory/discardable_m...
base/memory/discardable_memory.h:25: #define
DISCARDABLE_MEMORY_SUPPORTED_NATIVELY
BTW it's likely that we will need to turn this into a runtime function rather
than a #define. The reason I had DiscardableMemory::Supported was that the
concept showed up in Win8, so if we go native on Win32 it won't be compile time.

Powered by Google App Engine
This is Rietveld 408576698