Re: Why does the memory increase?
Re: Why does the memory increase?
- Subject: Re: Why does the memory increase?
- From: Chris Ridd <email@hidden>
- Date: Thu, 06 Jun 2002 16:31:12 +0100
Lorenzo Puleo <email@hidden> wrote:
>
Hi,
>
Before launching this task the memory was 5MB, and at the end of this task
>
the memory remains at 9MB. Since I remove all the objects from the
>
instance gItemsToCopyArray, it should come back to the initial value...
>
Please, may someone explain/fix this?
I haven't looked at your code at all, so there may be a leak.
Does OS X's free/release/whatever ever end up returning memory to the OS?
On some Unixes they *don't*, which often surprises people :-)
On Solaris this silly example keeps using over 10MB of memory even after
calling free:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
void *p;
p = malloc(10 * 1024 * 1024); /* 10 MB */
printf("Check process size and press a key\n");
getc(stdin);
free(p);
printf("Check process size again and press a key\n");
getc(stdin);
return 0;
}
On OS X (10.1.5) the process size dropped after the free(), but that might
be due to the process not doing any additional mallocs and frees and thus
not prove anything.
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.