This is the mail archive of the gdb@sourceware.cygnus.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]

Reducing memory usage


For starters, we don't try to not duplicate type info when reading dwarf2.
I've fixed this.
Doing this takes gdb, with all of it's symbols read in, from this:
Statistics for '/usr/local/gdb/src/gdb/gdb':
  Number of "stab" symbols read: 290212
  Number of "minimal" symbols read: 10600
  Number of "partial" symbols read: 160442
  Number of "full" symbols read: 237611
  Number of "types" defined: 129044
  Space used by a.out string tables: 974998
  Total memory used for psymbol obstack: 8017943
  Total memory used for psymbol cache: 948776
  Total memory used for symbol obstack: 24542604
  Total memory used for type obstack: 19411848

to this:

Statistics for '/usr/local/gdb/src/gdb/./gdb':
  Number of "stab" symbols read: 290212
  Number of "minimal" symbols read: 10600
  Number of "partial" symbols read: 160442
  Number of "full" symbols read: 155649
  Number of "types" defined: 105366
  Space used by a.out string tables: 974998
  Total memory used for psymbol obstack: 8017943
  Total memory used for psymbol cache: 948776
  Total memory used for symbol obstack: 18510936
  Total memory used for type obstack: 12585708

A savings of about 13 meg (and in percentages, we save 45% of the type
obstack, 25% of the symbol stack).

This only helps for dwarf2, stabs and whatnot were already doing something
similar.

I used the hashtable implementation libiberty now provides, rather than
introduce yet another gdb hashtable type.

Not too shabby, methinks.

Anyone want to test the patches for me, while i work on some more memory
reduction.
--Dan





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