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

  1. Path: sparky!uunet!gossip.pyramid.com!pyramid!unify!dbrus!tsv
  2. From: tsv@dbrus.Unify.Com (Tim Vannaman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: free() problem ...
  5. Message-ID: <1jnezou@Unify.Com>
  6. Date: 11 Sep 92 14:06:39 GMT
  7. References: <79398@ut-emx.uucp>
  8. Sender: news@Unify.Com (news admin)
  9. Organization: /usr/lib/news/organization
  10. Lines: 30
  11.  
  12. In article <79398@ut-emx.uucp> wangyu@ccwf.cc.utexas.edu (Yu Wang) writes:
  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.  
  33. Have you tried allocating memory again in the first program?  What I think
  34. is happening is that the memory is freed, but is then only available for 
  35. the program that alloc'd it in the first place.
  36.  
  37. Tim.
  38. --
  39. Tim Vannaman, Premium Technical Support Engineer   Phone: (916) 928-6433
  40. Unify Corporation, Sacramento, California    Fax: (916) 928-6403
  41. tsv@unify.Com  or  {{ucdavis,csun,lll-crg}!csusac,pyramid,sequent}!unify!tsv
  42.