home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gossip.pyramid.com!pyramid!unify!dbrus!tsv
- From: tsv@dbrus.Unify.Com (Tim Vannaman)
- Newsgroups: comp.lang.c
- Subject: Re: free() problem ...
- Message-ID: <1jnezou@Unify.Com>
- Date: 11 Sep 92 14:06:39 GMT
- References: <79398@ut-emx.uucp>
- Sender: news@Unify.Com (news admin)
- Organization: /usr/lib/news/organization
- Lines: 30
-
- In article <79398@ut-emx.uucp> wangyu@ccwf.cc.utexas.edu (Yu Wang) writes:
- >Hello guys,
- >
- >I got a question on free(). It looks to me that free() doesn't
- >actually make freed memory spaces available to other programs.
- >
- >I wrote 2 simple programs: the first one was to allocate, say, a 10MB
- >size array, then, free it (using free()), and put in an infinite
- >loop. After running the first program in background, I ran the
- >second program which used malloc() to grab as much memory as possible
- >and report the memory size that had been seized.
- >
- >I ran the second program many times during a long period of time, but
- >the available memory size I got from it was always 10MB less than the
- >number I got from running the second program prior to the first
- >program, i.e. 10 MB memory was never made available to other programs!
- >
- >Any help is greatly appreciated.
- >
- >Lena
-
- Have you tried allocating memory again in the first program? What I think
- is happening is that the memory is freed, but is then only available for
- the program that alloc'd it in the first place.
-
- Tim.
- --
- Tim Vannaman, Premium Technical Support Engineer Phone: (916) 928-6433
- Unify Corporation, Sacramento, California Fax: (916) 928-6403
- tsv@unify.Com or {{ucdavis,csun,lll-crg}!csusac,pyramid,sequent}!unify!tsv
-