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

Issue 661710 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[USS] Figure out the real memory overhead of LevelDB

Project Member Reported by maxbogue@chromium.org, Nov 2 2016

Issue description

LevelDB has some sort of overhead for caching and other database performance optimizations. Pavel says it can use up to 8mb of memory, which is huge. We should investigate what real-world memory usage is.

This is also relevant to leveldb_proto, which is used in several places in Chrome to spin up LevelDBs for specific protobuf types. If there is a high per-DB overhead cost, that pattern may want to be re-evaluated.
 

Comment 1 by zea@chromium.org, Nov 2 2016

Cc: dskiba@chromium.org
+Dmitry as well, in case they've looked at this.
Cc: ssid@chromium.org
So we have this thing, slow reports (go/slow-memory-reports), which gets data from dev/canary population. According to the data, in 40% cases leveldb consumes less than 0.5 MiB. In 18% cases it consumes 2-4 MiB. 4-8 MiB bucket accounts for 6%.
Hmm, thanks Dmitry! That's very interesting. Ideally we would be able to see (total memory / number of entities) for each DB as number of entities changes... is that something it would be possible to do? I don't know how those numbers are collected.
I think it should be possible, but we'll have to implement something similar to "leveldb.approximate-memory-usage" property LevelDB::OnMemoryDump() reports now, but for the number of entries.

Comment 5 by ssid@chromium.org, Nov 9 2016

Cc: tzik@chromium.org
If we are worried about the overhead, leveldb::Cache::Prune should clear the caches used in database. There was a plan to prune database cache on low memory pressure, but I didn't find any improvement in memory, so didn't implement it. Also, I have not investigated if it does clear all overhead.
+tzik who added this method.

The data shown in comment #2 includes the levelDB usage from LevelDBValueStore, IndexedDB and ProtoDatabase. It is not an universal total. To include usage from sync's levelDB database, we need to implement a dump provider (dskiba is working on it). For tracking total memory / number of entities from users, we could just add an attribute in the OnMemoryDump method if we know the number of entries.

Comment 6 by dskiba@chromium.org, Apr 14 2017

BTW, in  issue 711518  we're discussing leveldb::Options and their impact on memory.
Status: Archived (was: Available)

Sign in to add a comment