home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / bsd / 10790 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  2.0 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!mcsun!news.funet.fi!funic!nntp.hut.fi!nntp!Petri.Wessman
  2. From: Petri.Wessman@hut.fi (Petri Wessman)
  3. Newsgroups: comp.unix.bsd
  4. Subject: GNU malloc (was: gcc-2.3.2 and kernel build)
  5. Message-ID: <PETRI.WESSMAN.92Dec31154930@lk-hp-9.hut.fi>
  6. Date: 31 Dec 92 15:49:30 GMT
  7. References: <RANDY.92Dec28095652@dsndata.dsndata.com> <1hqciuINN620@usenet.INS.CWRU.Edu>
  8. Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
  9. Reply-To: Petri.Wessman@hut.fi
  10. Organization: La Gata Encantada
  11. Lines: 33
  12. In-Reply-To: ljo@murphy.eeap.cwru.edu's message of 29 Dec 1992 20:31:26 GMT
  13. Nntp-Posting-Host: lk-hp-9.hut.fi
  14.  
  15. On 29 Dec 1992 20:31:26 GMT, ljo@murphy.eeap.cwru.edu (L. Jonas Olsson) said:
  16.  
  17. Olsson> (If you're short of RAM and/or swap space you can try to
  18. Olsson> replace your malloc routines in libc.a with the gnu malloc
  19. Olsson> routines. On my system this results in gcc and several other
  20. Olsson> large programs using only half as much data-space. For example
  21. Olsson> with gcc -dm aprog.c you can see how much data gcc is using. I
  22. Olsson> don't know why the data size is decreased and if the new
  23. Olsson> malloc routines will break some other programs)
  24.  
  25. No kidding on the space savings! I grabbed a copy of GNU malloc from
  26. the glibc-1.05 distribution and popped it into libc.a. Here are some
  27. results of gcc 2.3.3 -dm (Data size used) for a few (gcc) example files:
  28.  
  29. Compiler    file        dist malloc    GNU malloc    new compared
  30.                                 to old
  31. --------    ----        -----------    ----------    ------------
  32. gcc         expr.c        2580440         872412        33.8%
  33.         calls.c        1671128         696284        41.7%
  34.         c-parse.c    2056152        1056732        51.4%
  35.  
  36. gcc -O        expr.c        2973656         909276        30.5%
  37.         calls.c        1777624         692188        38.9%
  38.         c-parse.c    2269144        1028060        45.3%
  39.  
  40. Thanks for the tip, ljo! Now I can compile programs that used to bring
  41. my machine to its knees with swapping (I only have 4MB RAM).
  42.  
  43. Of course, I have no idea of the other implications of using GNU
  44. malloc. Is it slower/buggier/somehtinga than the dist malloc? Anyone
  45. know of a good reason *not* to use it?
  46.  
  47. //Petri
  48.