<div dir="ltr">This is correct: the numbers are total allocations, and I believe there's not a lot of deallocations there, so this is a good place to optimize.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 5, 2016 at 5:40 PM, Peter Collingbourne <span dir="ltr"><<a href="mailto:peter@pcc.me.uk" target="_blank">peter@pcc.me.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Feb 05, 2016 at 04:58:45PM -0800, Mehdi Amini wrote:<br>
><br>
> > On Feb 5, 2016, at 3:17 PM, Peter Collingbourne via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> ><br>
> > Hi all,<br>
> ><br>
> > We have profiled [1] the memory usage in LLVM when LTO'ing Chromium, and<br>
> > we've found that one of the top consumers of memory is the DWARF emitter in<br>
> > lib/CodeGen/AsmPrinter/Dwarf*.<br>
><br>
> I'm staring at the profile attached to the post #15 on the link you posted, can you confirm that the Dwarf emitter accounts for 6.7%+15.6%=22.3% of the the total allocated memory?<br>
> If I understand correctly the numbers, this does not tell anything about how much the Dwarf emitter accounts on the *peak memory* usage (could be more, could be nothing...).<br>
<br>
I think these nodes represent allocations from the DWARF emitter:<br>
<br>
DwarfDebug::DwarfDebug 9.5%<br>
DwarfDebug::endFunction 15.6%<br>
DIEValueList::addValue 9.1%<br>
total 34.2%<br>
<br>
I believe they are totals, but my reading of the code is that the DWARF<br>
emitter does not deallocate its memory until the end of code generation,<br>
so total ~= peak in this case.<br>
<br>
I am not surprised by these figures -- see e.g. DIEValueList::Node which in<br>
the worst case can use up to 24 bytes on a 1-byte DWARF attribute record.<br>
<br>
Ivan was the person who collected the numbers, he may be able to comment more.<br>
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Peter<br>
</font></span></blockquote></div><br></div>