[gnu.gdb.bug] more info on gdb3.5 memory bloat

glenne@HPLSLA.HP.COM (Glenn Engel) (02/18/90)

Re: previous bug report about gdb using significantly more memory than
    gdb3.4.

After a debug session on gdb 3.5 I discovered that the problem appears
to be in the malloc.c provided with gdb.

When reading my executable's symbol table, malloc is called 841 times
to request 4088 bytes.  After every one of these 4088 byte malloc calls,
the data segment size goes up by 8192 bytes.  As a result, gdb uses
an extra 3.5 Megabytes of data space.  Linking in the system malloc.o
instead seems to fix the problem.  Looking back, I see that I used the
system malloc on gdb3.4 as well.

--
glenne@hplsla.hp.com

pcg@aber-cs.UUCP (Piercarlo Grandi) (02/22/90)

In article <9002172100.AA17438@labgre.HP.COM> glenne@HPLSLA.HP.COM (Glenn Engel) writes:
  Re: previous bug report about gdb using significantly more memory than
      gdb3.4.
  
  When reading my executable's symbol table, malloc is called 841 times
  to request 4088 bytes.  After every one of these 4088 byte malloc calls,
  the data segment size goes up by 8192 bytes.

Maybe you should use the malloc() I have posted time ago in alt.sources.
I will be reposting it to comp.sources.misc soon.

Malloc()s like the GNU one that are based on the Caltech one use a kind
of buddy system, in the vain hope this will make them fast. The only
result is that they become much less space efficient.

Another thing, entirely different: I will be posting shortly some simple
patches to GDB main.c that avoid including readline and company. This
library consumes about 30% of the code space of GDB. I don't need it,
because I have history processin as a line discipline in my tty
driver (thanks to A. Shepherd's CLED). There are also a lot of other
solutions to the line editing/history problem, such as using rk, atty,
or any editor with shell buffers, and under these readline is useless as
well.
-- 
Piercarlo "Peter" Grandi           | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcvax!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk

meissner@osf.org (02/23/90)

| Another thing, entirely different: I will be posting shortly some simple
| patches to GDB main.c that avoid including readline and company. This
| library consumes about 30% of the code space of GDB. I don't need it,
| because I have history processin as a line discipline in my tty
| driver (thanks to A. Shepherd's CLED). There are also a lot of other
| solutions to the line editing/history problem, such as using rk, atty,
| or any editor with shell buffers, and under these readline is useless as
| well.

Fine, make it optional, because I for one want the readline stuff.  It
has one piece of functionality that line disciplines can't have, and
that is auto-completion of symbol names (ie, hit fred<tab>, and it
will try to complete fred, and fred<esc>? lists all of the names that
start with fred).