This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Reducing memory usage
- To: gdb at sourceware dot cygnus dot com
- Subject: Reducing memory usage
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Sun, 9 Apr 2000 15:29:59 -0700 (PDT)
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