[clangd] Fix bugs with incorrect memory estimate report
authorKirill Bobyrev <kbobyrev.opensource@gmail.com>
Wed, 26 Sep 2018 15:06:23 +0000 (15:06 +0000)
committerKirill Bobyrev <kbobyrev.opensource@gmail.com>
Wed, 26 Sep 2018 15:06:23 +0000 (15:06 +0000)
commitea4f20c6bef7ee65a820e65f93efe0af97997a14
treecd16956d5f8ada3455914d4b050644897f3657b7
parent0cdf629394ac6b4081aa8952d99442e8c1f313d8
[clangd] Fix bugs with incorrect memory estimate report

* With the current implementation, `sizeof(std::vector<Chunk>)` is added
twice to the `Dex` memory estimate which is incorrect
* `Dex` logs memory usage estimation before `BackingDataSize` is set and
hence the log report excludes size of the external `SymbolSlab` which is
coupled with `Dex` instance

Reviewed By: ioeric

Differential Revision: https://reviews.llvm.org/D52503

llvm-svn: 343117
clang-tools-extra/clangd/index/Serialization.cpp
clang-tools-extra/clangd/index/dex/Dex.cpp
clang-tools-extra/clangd/index/dex/PostingList.h