home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / c / 13360 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.1 KB

  1. Path: sparky!uunet!cs.utexas.edu!ut-emx!ccwf.cc.utexas.edu!wangyu
  2. From: wangyu@ccwf.cc.utexas.edu (Yu Wang)
  3. Newsgroups: comp.lang.c
  4. Subject: free() problem ...
  5. Message-ID: <79398@ut-emx.uucp>
  6. Date: 9 Sep 92 04:20:40 GMT
  7. Sender: news@ut-emx.uucp
  8. Reply-To: wangyu@ccwf.cc.utexas.edu (Yu Wang)
  9. Organization: The University of Texas at Austin, Austin TX
  10. Lines: 19
  11. Originator: wangyu@grumpy.cc.utexas.edu
  12.  
  13. Hello guys,
  14.  
  15. I got a question on free().  It looks to me that free() doesn't
  16. actually make freed memory spaces available to other programs.
  17.  
  18. I wrote 2 simple programs: the first one was to allocate, say, a 10MB
  19. size array, then, free it (using free()), and put in an infinite
  20. loop.  After running the first program in background, I ran the
  21. second program which used malloc() to grab as much memory as possible
  22. and report the memory size that had been seized.
  23.  
  24. I ran the second program many times during a long period of time, but
  25. the available memory size I got from it was always 10MB less than the
  26. number I got from running the second program prior to the first
  27. program, i.e. 10 MB memory was never made available to other programs!
  28.  
  29. Any help is greatly appreciated.
  30.  
  31. Lena
  32.