Asterisk proces memory increase

Home » Asterisk Users » Asterisk proces memory increase
Asterisk Users 3 Comments

Hello,

I notice that at the end of the day, after about 4000 calls have passed
my Asterisk-system, that the use of memory is very high and stays that
way untill a restart of Asterisk or a reboot of the server.

This is the situation at the end of the day :

[root@sp asterisk]# free -m
total used free shared buffers cached
Mem: 3923 1931 1992 0 268 1308
-/+ buffers/cache: 353 3569
Swap: 4031 0 4031

So total of 3923MB, where 1992MBis used and 1931MBstill free.

This memory never decreases and increases with every call that passes my
Asterisk system. After some more calls :

[root@sp asterisk]# free -m
total used free shared buffers cached
Mem: 3923 1934 1989 0 270 1309
-/+ buffers/cache: 353 3569
Swap: 4031 0 4031

So total of 3923MB, where 1934MBis used and 1989MBstill free.

As I said, only a restart of Asterisk or reboot of the server can
decrease this value :

[root@sp asterisk]# free -m
total used free shared buffers cached
Mem: 3923 974 2948 0 150 524
-/+ buffers/cache: 299 3624
Swap: 4031 0 4031

So total of 3923 MB, where 974 MB is used and 2948 MB still free.

So why does this memory usage only decrease with a restart ? What keeps
asterisk stored in the RAM-memory ? Even if there are 0 calls, the
memory does not decrease.

3 thoughts on - Asterisk proces memory increase

  • AFAIK:
    Linux has a tendency to keep RAM filled up with any recently accessed
    progarm. To keep programs access fast enough, it never removes something
    from the memory, only replaces it, in case some program has more frequent
    access than the one already present in ram.

    If your server isn’t swapping.. things are okay.

  • Un top-posting…

    Another minor comment on this. It is better to look at the -/+ line of the
    free output to see the amount of free memory that is available. This line
    moves memory used by the page cache from the used to free column. In your
    case the running asterisk server had 3569MB free before reboot and 3624MB
    after.

    You can also flush the page cache and *truly* free that memory with “echo 1 >
    /proc/sys/vm/drop_caches”. This means the system will take a performance hit
    when since it must reload from disk those pages which you just flushed the
    next time those files are accessed.

    Cheers,
    Shaun