home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / question / 10765 < prev    next >
Encoding:
Internet Message Format  |  1992-09-07  |  1.8 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!ucbvax!sequent.cc.hull.ac.uk!S.Marshall
  2. From: S.Marshall@sequent.cc.hull.ac.uk (Simon Marshall)
  3. Newsgroups: comp.unix.questions
  4. Subject: Does free() really free?
  5. Message-ID: <9209051620.AA02618@ucbvax.Berkeley.EDU>
  6. Date: 5 Sep 92 17:17:25 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 27
  9.  
  10. Or: How do I find out the real size of a running process?
  11.  
  12.     Hi all.  This is really a question about the Sequent's shfree(), but
  13.     in tests it seems to apply to other machines and free() in general.
  14.     Please can anyone give a knowledgable answer?
  15.  
  16.     If I malloc(), then free(), the SZ (SIZE) column of ps does not show
  17.     the expected fall.  I don't believe that the system ignores freed space,
  18.     but then again I know that software that I have written thrashes
  19.     machines, despite the fact that most of the memory malloc()ed is
  20.     subsequently free()ed.
  21.  
  22.     On our Sequent and Suns, for example, once the SZ column shows
  23.     70Meg+, you can see the machines thrash.  But I can work out that the
  24.     actual unfreed memory only amounts to at most 15Meg.
  25.  
  26.     So, please could anyone tell me what is going on here?  Does free()
  27.     actually free, and is the SZ column of ps reliable in any way?  Or is
  28.     free() working as expected, ps lying, but 15Meg is too much?  Surely
  29.     not?!  I'd welcome anything emailed/posted.  (Except unhelpful questions
  30.     of the order `why are you mallocing then freeing so much' etc. :-)
  31.  
  32.     Thanks in advance, Simon.
  33. _______________________________________________________________________________
  34. Simon Marshall, Dept. of Computer Science, University of Hull, Hull HU6 7RX, UK
  35.   "Football isn't about life and death.  It's more important than that." Bill
  36. Email: S.Marshall@Hull.ac.uk    Phone: +44 482 465181    Fax: 466666   Shankley
  37.