[Asterisk-Users] Other memory stuff

Steve Kann stevek at stevek.com
Fri May 13 14:04:34 MST 2005


Wiley Siler wrote:

> On a similar note, I have a server with 1GB of memory that seems to 
> never release the memory back to system use.
> The system is AAH 0.9.  Dual AMD Athlon.
>
> This system does IAX out ot my voip providers and has 2 TDM400 cards 
> in it for connection to my POTS lines.
>
> I never have more than 10 calls active at a time.  There is no 
> transcoding.  It is all uLaw.
>
> Does anyone out there have a problem where memory is not released back 
> to the system?
>

Generally, memory on the heap cannot be "reclaimed" by the system, in 
the sense that the processes VM Size will go down.  Consider this:

void *p1, *p2;

p1 = malloc(1024*1024*1024);
p2 = malloc(1);

/* assume p2 > p1 */
free(p1);  p1=NULL;

/* your program continues for hours or days */

Now, malloc can't "return" p1 to the system;  It can only remember that 
the 1GB of memory is now available for future calls to malloc.

However, if you never actually used p1, then the memory was never really 
used.  Or, if you had, it will just end up paged to disk if you never 
touch it again.

-SteveK




More information about the asterisk-users mailing list