<div dir="ltr"><div>(Adding Hyoun who's been looking at memory use of llvm-symbolizer recently too)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 14, 2020 at 11:07 AM Francis Ricci via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I work on a linux program with restricted RSS limits (a couple hundred MB), and one of the things this program does is symbolication. Ideally, we'd like to use llvm-symbolizer for this symbolication (because we get things like function inlining that we can't get from cheaper symbolizers), but for large binaries, the memory usage gets pretty huge.<div><br></div><div>Based on some memory profiling, it looks like the majority of this memory cost comes from mmap-ing the binary to be symbolized (via `llvm::object::createBinary"). This alone comes with hundreds of MB of cost in many cases.</div><div><br></div><div>I have 2 questions here:</div><div>1) Does it seem feasible to make llvm-symbolizer work *without* loading the full binary into memory (perhaps just reading sections from disk as needed, at the cost of some extra CPU)?</div></div></blockquote><div><br></div><div>Does memory mapping the file actually use real memory? Or is it just reading from the file, effectively? I don't think the mapped file was part of the memory usage Hyoun and I encountered when doing memory accounting. What we were talking about was an LRU cache of DwarfCompileUnits, or something like that - to strip out the DIEArrays and other associated data structures after they were used.<br><br>Are you running llvm-symbolizer on many input addresses in a single run? Only a single address? Optimized or unoptimized build of llvm-symbolizer?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>2) If we figured this out, and put it behind something like a "--low-memory" flag, would it be something the upstream community would accept?<br></div></div></blockquote><div><br>Maybe, though I'm hoping we can avoid having to have too much of a perf tradeoff for low memory usage, so we can keep it all together without a flag.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br>Francis</div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>