• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why does the memory increase?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Why does the memory increase? (From: Lorenzo Puleo <email@hidden>)

  • Prev by Date: When do documents position windows?
  • Next by Date: Re: NSApp's currentEvent
  • Previous by thread: Why does the memory increase?
  • Next by thread: Re: Why does the memory increase?
  • Index(es):
    • Date
    • Thread