|
|
Created:
4 years, 4 months ago by flackr Modified:
4 years, 3 months ago Reviewers:
haraken CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews+fetch_chromium.org, tyoshino+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionEvict resources from memory cache after running rendering test.
BUG=640344
TEST=Manual steps in bug.
Committed: https://crrev.com/c90a6ca1d464e103448621a244ebb93e1f7d440c
Cr-Commit-Position: refs/heads/master@{#414691}
Patch Set 1 #Patch Set 2 : Evict resources after running RenderingTest. #
Total comments: 1
Messages
Total messages: 14 (4 generated)
flackr@chromium.org changed reviewers: + haraken@chromium.org
Can you take a look at this? Please also see my comments on the bug. It seems dangerous that these RefPtr's are not necessarily cleared because they are still in the memory caches memory (and were technically not destructed). Should we be clearing all of the RefPtr's explicitly?
Description was changed from ========== Explicitly remove reference to RefPtr on ResourceRequest. BUG=640344 TEST=Manual steps in bug. ========== to ========== Evict resources from memory cache after running rendering test. BUG=640344 TEST=Manual steps in bug. ==========
On 2016/08/25 at 17:14:01, flackr wrote: > Can you take a look at this? Please also see my comments on the bug. It seems dangerous that these RefPtr's are not necessarily cleared because they are still in the memory caches memory (and were technically not destructed). Should we be clearing all of the RefPtr's explicitly? As I mentioned in the bug, it seems we just need to manually call evictResources() after running a rendering test to ensure these resources are cleaned up.
https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp (right): https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp:48: memoryCache()->evictResources(); Just help me understand: What's a difference between prune() and evictResource()? Is calling prune() not enough to release the underlying Resources?
On 2016/08/26 at 00:58:50, haraken wrote: > https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp (right): > > https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp:48: memoryCache()->evictResources(); > > Just help me understand: What's a difference between prune() and evictResource()? Is calling prune() not enough to release the underlying Resources? Correct, prune is what is called when the resource is no longer needed, and it is exiting on the "fast path" in the test because the capacity has not been reached: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/fetch/Mem...
On 2016/08/26 01:17:03, flackr wrote: > On 2016/08/26 at 00:58:50, haraken wrote: > > > https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... > > File third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp (right): > > > > > https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... > > third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp:48: > memoryCache()->evictResources(); > > > > Just help me understand: What's a difference between prune() and > evictResource()? Is calling prune() not enough to release the underlying > Resources? > > Correct, prune is what is called when the resource is no longer needed, and it > is exiting on the "fast path" in the test because the capacity has not been > reached: > https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/fetch/Mem... Then what's a difference between pruneAll() and evictResources()?
On 2016/08/26 01:43:33, haraken wrote: > On 2016/08/26 01:17:03, flackr wrote: > > On 2016/08/26 at 00:58:50, haraken wrote: > > > > > > https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... > > > File third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp (right): > > > > > > > > > https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... > > > third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp:48: > > memoryCache()->evictResources(); > > > > > > Just help me understand: What's a difference between prune() and > > evictResource()? Is calling prune() not enough to release the underlying > > Resources? > > > > Correct, prune is what is called when the resource is no longer needed, and it > > is exiting on the "fast path" in the test because the capacity has not been > > reached: > > > https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/fetch/Mem... > > Then what's a difference between pruneAll() and evictResources()? pruneAll() doesn't remove references to "live" resources. Also, prune-related things contain many heuristics and are not well-tested, so I'd like to avoid calling pruneAll() in tests, unless we are testing pruneAll() behavior itself. evictResources() has clearer semantics ("clear all MemoryCache entries") and looks more appropriate for this kind of teardown.
On 2016/08/26 04:58:55, hiroshige wrote: > On 2016/08/26 01:43:33, haraken wrote: > > On 2016/08/26 01:17:03, flackr wrote: > > > On 2016/08/26 at 00:58:50, haraken wrote: > > > > > > > > > > https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... > > > > File third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp (right): > > > > > > > > > > > > > > https://codereview.chromium.org/2278723002/diff/20001/third_party/WebKit/Sour... > > > > third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp:48: > > > memoryCache()->evictResources(); > > > > > > > > Just help me understand: What's a difference between prune() and > > > evictResource()? Is calling prune() not enough to release the underlying > > > Resources? > > > > > > Correct, prune is what is called when the resource is no longer needed, and > it > > > is exiting on the "fast path" in the test because the capacity has not been > > > reached: > > > > > > https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/fetch/Mem... > > > > Then what's a difference between pruneAll() and evictResources()? > > pruneAll() doesn't remove references to "live" resources. > Also, prune-related things contain many heuristics and are not well-tested, so > I'd like to avoid calling pruneAll() in tests, unless we are testing pruneAll() > behavior itself. > evictResources() has clearer semantics ("clear all MemoryCache entries") and > looks more appropriate for this kind of teardown. Ah, thanks. That makes sense. LGTM.
The CQ bit was checked by flackr@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Evict resources from memory cache after running rendering test. BUG=640344 TEST=Manual steps in bug. ========== to ========== Evict resources from memory cache after running rendering test. BUG=640344 TEST=Manual steps in bug. Committed: https://crrev.com/c90a6ca1d464e103448621a244ebb93e1f7d440c Cr-Commit-Position: refs/heads/master@{#414691} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/c90a6ca1d464e103448621a244ebb93e1f7d440c Cr-Commit-Position: refs/heads/master@{#414691} |