New issue
Advanced search Search tips

Issue 750770 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 758267
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Feature

Blocking:
issue 750751



Sign in to add a comment

Modify leveldb memory-infra reporting to account for shared cache.

Project Member Reported by cmumford@chromium.org, Jul 31 2017

Issue description

In commit #488099 a shared read block cache was introduced for some uses of leveldb. This complicates the reporting of leveldb as the resource cost of the block cache is amortized over all open databases. One of the following needs to be done:

1. If a block can be associated with a specific database
   then associate that use appropriately.
2. If not #1 then use the appropriate memory-infra API to
   associate the shared resource with all leveldb using that
   cache.
 
Labels: -Type-Bug Type-Task
Labels: -Type-Task Type-Feature
Components: Blink>Storage
Blocking: 750751
Owner: dskiba@chromium.org
Status: Started (was: Assigned)
dskiba@ Please advise on the correct *MemoryDump function to use for this reporting and assign back to me. thx.
Labels: Needs-Feedback
Labels: -Needs-Feedback
Owner: cmumford@chromium.org
I saw a comment that suggested the correct way to do this is with AddSuballocation.
I think we should report shared resources (env and block cache) as follows:

1. Include size of a shared resource to DB's total number
2. Report shared resource separately
3. Suballocate shared resource from DB

For example for block cache:

1. Size of block cache is already included to DB::GetProperty("approximate-memory-usage"). The only change here is to report databases as "leveldatabase/db/0x..." instead of "leveldatabase/0x..." for consistency.

2. Report size of block cache as "leveldatabase/block_cache/0x....".

3. Suballocate "leveldatabase/block_cache/0x...." from "leveldatabase/db/0x...".

And then memory-infra should correctly calculate totals for "leveldatabase" and each "leveldatabase/db". The only thing is that this calculation is done in the UI now, so there is no way we can write a unittest. Although I think there is work to move that calculation to Chrome itself.

In the end we should end up with "leveldatabase" provider that surfaces:

1. Totals per shared resource (block cache, env).
2. Totals per DB (with shared resource accounted proportionally).

ssid@, does this sound good to you? Who is responsible for moving calculation of totals from UI to Chrome itself?
Cc: ssid@chromium.org
ssid@, please see previous comment.
Mergedinto: 758267
Status: Duplicate (was: Started)

Sign in to add a comment