Index: lib/DebugInfo/DWARF/DWARFDebugLine.cpp =================================================================== --- lib/DebugInfo/DWARF/DWARFDebugLine.cpp +++ lib/DebugInfo/DWARF/DWARFDebugLine.cpp @@ -520,6 +520,11 @@ // rudimentary sequences for address ranges [0x0, 0xsomething). } + // There could be hundreds or thousands of Rows in the line table. The vector + // will likely have an internal reserved memory block that is much bigger + // than necessary. Reduce the reserved capacity to conserve memory. + Rows.shrink_to_fit(); + return end_offset; }