[PATCH] D51618: [dsymutil] Reduce peak memory usage for the single threaded execution.

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 03:18:59 PDT 2018


JDevlieghere created this revision.
JDevlieghere added reviewers: friss, aprantl.

Keeping the compile units in memory is expensive. For the single threaded case we allocate them in the analyze part and deallocate them again once we've finished cloning. This poses a problem in the single threaded case where we did all the analysis first followed by all the cloning. This meant we had all the link context in memory right after analyzing finished.

This patch changes the way we order work in the single threaded case. Instead of doing all the analysis and cloning in serial, we now interleave the two so we can deallocate the memory as soon as a file is processed. The result is binary identical and peak memory usage went down from 13.43GB to 5.73GB for a debug build of trunk clang.


Repository:
  rL LLVM

https://reviews.llvm.org/D51618

Files:
  llvm/tools/dsymutil/DwarfLinker.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51618.163774.patch
Type: text/x-patch
Size: 10486 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180904/cdf52d54/attachment.bin>


More information about the llvm-commits mailing list