On Wed, May 27, 2009 at 2:33 AM, Ikin Wirawan <ikin at qorser.com>
wrote:> There are also two more info that may help:
> 1) Asterisk consumes 495mb of memory on this production server, while only
> 42kB on local/development machine
> 2) agi_ccmain (and other agi scripts) consumes 146mb of memory on
> production, while only 32kB on local
This is the second or more questions in a few days that claims memory
leak with no proof. Please google 'memory leak' before throwing around
the term. You do not have any evidence of that.
As for why it takes more memory in production than in your test, an
obvious guess is because there are more simultaneous instances of your
process in your production environment than in your test environment.
Here's how you compare apples to apples...
Put your test server into production, and then compare the memory
usage. You have way too many variables to make any conclusions about
anything.
> My questions are:
> - How come Asterisk, and my PHP/AGI scripts consume so much memory on
> production compared to local machines?
I don't know, and neither do you. Switch the systems and try again. Do
you have the same version, same compiled options, and same number of
simultaneous PHP engines running in your test? The obvious suggestion
is you are running more instances of your AGIs in prod than in test.
Ergo, more memory usage.
> - Any idea why there is a memory leak? -
You don't have any evidence of a memory leak. Linux caches programs in
ram in the event they get run again. Linux the kernel and other smart
programs cache/buffer previously used items in memory, in the (usually
likely) event that you want them again, and they won't have to be read
from hard drive in the future. That's not called a memory leak. That's
called evidence-based performance enhancements.
>Is it a bug on Asterisk?
Doubtful.