Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(buffers): Work around a LevelDB mechanism mismatch (#7398)
* Work around a LevelDB mechanism mismatch This commit moves the computation of the byte size of a disk buffer into a separate function with a separate, temporary LevelDB handle. When we iterate LevelDB it maps up to 1000 LDB files into vector's address space, which is fine for a database but imposes a large memory burden on vector users. See google/leveldb#866 for details. Unfortunately LevelDB is not configurable in this regard without forking their code base and so we are temporarily working around the issue, kind of. The pattern will be this. At startup vector will scan each of its LDB files for each disk buffer (see #7380) and map up to 1000 LDB files into vector's address space, consuming however much memory to do this. Once `db_initial_size` returns the LevelDB handle will drop and each file will be unmapped, reducing vector's overall memory use. This will NOT resolve OOM issues for our memory constrained users but it WILL reduce vector's post-startup memory burden, at least until LevelDB maps in more LDB files which will happen gradually. REF #7246 Signed-off-by: Brian L. Troutwine <brian@troutwine.us> * clippy ding Signed-off-by: Brian L. Troutwine <brian@troutwine.us>
- Loading branch information