discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with NSAutoreleasePool in GNUstep


From: Wim Oudshoorn
Subject: Re: Problem with NSAutoreleasePool in GNUstep
Date: Mon, 3 Dec 2001 16:09:54 +0100

You wrote:

> I still could not get why memory usage is not coming down after [pool
> release]. In OpenStep the memory usage does come down?
>
> This problem is not with particular machine, it is coming on all machines

Writing from a dim recollection of how memory allocation works, so take this 
with a grain of salt.

It probably is not a problem with the Autorelease Pools, but it is just the way
memory allocation works on the systems you work on.   If you allocate a block
memory, for example with malloc, the (g)libc libray uses the sbrk (?) system  
call to increase the address space of the appliation.  Memory is only  
returned to the system when the (g)libc library decides to give the memory
back with the sbrk system call.
If I remember correctly the sbrk mechanism works like a stack, that is, you
can not give arbitrary blocks back to the Operating system, but only from
the top/bottom part of the address space.

I might have this completely wrong, but for more information you should
consult the info files that come with (g)libc.

Wim Oudshoorn.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]