Dwp tool heap usage, reducing the memory foot-print.
Sriraman Tallam
tmsriram@google.com
Tue Nov 17 22:56:00 GMT 2015
Hi,
We do dwp runs involving very large .dwp/.dwo files (a few GB). I
was looking at reducing the memory foot-print of dwp and we noticed
this in function void Dwp_output_file::finalize():
// Write the debug string table.
if (this->have_strings_)
{
this->stringpool_.set_string_offsets();
section_size_type len = this->stringpool_.get_strtab_size();
buf = new unsigned char[len];
this->stringpool_.write_to_buffer(buf, len);
....
We are allocating a heap buffer to copy the stringpool buffer and then
writing that to the output file. Why not just do it directly? I see
this is done in two places, one to write the debug string table and
another to write the section string table. These allocations are
pretty significant (each ~20% the size of the input files combined).
Looking into stringpool functions, I see there is one to write
directly to a file
template<typename Stringpool_char>
void Stringpool_template<Stringpool_char>::write(Output_file* of, off_t offset)
but that needs an Output_file object and we dont have one. What is the
downside of eliminating this buffer?
Thoughts?
Thanks
Sri
More information about the Binutils
mailing list