This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: fail to improve psymtab memory consumption



Daniel Berlin <dan@cgsoftware.com> writes:
> Hence the reason I only read the part of the various sections for a
> given CU (rather than reading the entire section).

Yeah, I think that's the way to go.  The 12Mb of .debug_info,
.debug_abbrev, and .debug_line data lying there is the biggest issue.
There's no reason we couldn't read it in for partial symbol table
construction, throw it away when we're done, and then bring in data
for only those CU's we need, only when we need it.

GNU malloc uses mmap for big chunks of data, so when you free a big
block of memory (like debug_info_buffer) after doing the partial
symbol scan, the memory really does go back to the system; it doesn't
just get added to malloc's free list.

> I actually use mmap when possible, but that's for speed, rather than
> memory savings.

Is it really faster?

> It doesn't buy us anything if we still mmap the entire section, and
> then touch every part. :)

Which we do when in building the partial symbol table.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]