home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / fj / maillis / xwindow / 17660 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  2.6 KB

  1. Path: sparky!uunet!stanford.edu!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!wsservra!daemon
  2. From: rescorla@rtnmr.chem.yale.edu (Eric Rescorla)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Re: FLAME, FLAME ON X!!!
  5. Message-ID: <1992Nov19.234047.26496@sm.sony.co.jp>
  6. Date: 19 Nov 92 23:40:47 GMT
  7. Sender: daemon@sm.sony.co.jp (The devil himself)
  8. Distribution: fj
  9. Organization: Rescorla for himself.
  10. Lines: 42
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: Wed, 18 Nov 1992 19:49:05 GMT
  14. Message-Id: <1992Nov18.194905.16185@cs.yale.edu>
  15. Newsgroups: comp.windows.x
  16. References: <1683@igd.fhg.de>, <1992Nov9.235741.25166@dsd.es.com>, <1992Nov18.183826.2652@lsl.co.uk>
  17. Sender: xpert-request@expo.lcs.mit.edu
  18.  
  19. In article <1992Nov18.183826.2652@lsl.co.uk> snail@lsl.co.uk writes:
  20. >In article <1992Nov9.235741.25166@dsd.es.com>, pmartz@dsd.es.com (Paul Martz) writes:
  21. >> Care to tell us in which vendor's X is this a bug? I've certainly
  22. >> never heard of it before.
  23. >
  24. >This is NOT an X bug. This is a feature of C's memory allocation routines. When
  25. >memory is allocated, if there is no spare space, the C library asks the
  26. >OS for more memory, but when memory is freed, C does not give the memory back
  27. >to the OS. As a result programs can only get bigger, or stay the same size as
  28. >memory as allocated and freed. The program gets bigger every time memory is
  29. >requested and cannot be allocate out of the current free heap space. When this
  30. >happens the C library ask the OS for more memory. When the memory is freed,
  31. >it is returned to the free memory heap, not the OS.
  32. >
  33. >*** This is not a UNIX feature, this is a C feature, to be found on PCs, Ataris
  34. >, UNIX boxes, VAXes etc. This a feature, ie: C is designed this way. ****
  35. >
  36. >My apologies for replying to this thread 3 days late, someone has probably said
  37. >this before. But then again, maybe they haven't.
  38. I hope not. It's wrong. It is not part of the definition of the
  39. C language or of malloc(3). It happens that it is a very common way to
  40. do things, because sbrk(2) calls are expensive and it's not obviously
  41. worthwhile to return memory to the system. (This is on Unix. I imagine
  42. that similar conditions obtain on other machine.)
  43.  
  44. However, it would be quite legal to return the memory to the OS. I believe
  45. Jim Frost mentioned previously that he had in fact written such a malloc
  46. routine.
  47. -Ekr
  48.  
  49.  
  50. -- 
  51. -------------------------------------------------------------------------------
  52. Eric Rescorla, DoD#431 (Nighthawk S)              rescorla@rtnmr.chem.yale.edu
  53. Former chemist now CM400 mechanic                 ekr@eitech.com(preferred)
  54.                 "Meet the new boss, same as the old boss."
  55.