Asterisk does not free the memory allocated for the CPU cache

Colleagues, tell me, from which side should I approach the problem?

Apparently, Asterisk occupies, but does not free up memory for the CPU cache during operation.

I am using the htop utility and I see yellow characters growing in the Mem section, indicating the fraction of RAM used by the CPU cache. At the same time, the memory occupied by the kernel, applications, and buffers is freed quite normally.

Here is what is said in detail about cache - “kernel memory residing in RAM and used to store the contents of files read from disk”.
In about one or three days of operation, this cache takes up all the memory and problems begin with sound streams - in fact, they start working 10-20 seconds after connecting. After a reboot, the amount of memory occupied by this cache decreases to a very small one, and in the absence of a telephone load, it hardly grows or grows, but very slowly.

Where to find the cause of the problem?
Appreciated in advance for ideas.


Why do you think is this a problem?

As well, that’s not Asterisk’s to free. That’s normal functionality of the Linux kernel to use unused memory for disk cache. Looking elsewhere to identify your issue is most likely required.

Both Linux and Windows maximise memory usage in this way, as a matter of policy; as Joshua says, it is completely normal. The only time cache would be a warning sign is is it was becoming very small. I don’t have htop on the machine I’m using, but free, actually displays both a free and available memory figure, where the latter excludes buffers and cache.

Also, this is not the CPU cache, it is a backing store (e.g. disk) cache.

I suppose something is not working quite right. If I knew a more precise answer, I would not ask the question.

Do you think this is an operating system problem? Thanks.

No? I do not know. You’d have to do analysis. Look at packet captures, identify the specific scenario, isolate further.

On the Wikipedia page about htop, exactly the phrase I quoted is written. True, the most informative was the Russian-language page. Especially for fans of Chekhov, Tolstoy and Dostoevsky - htop — Википедия

I don’t think there enough information to know why your media is slow to start.

I suppose it could be a virtualisation problem, if the virtual machines doesn’t have enough memory dedicated to it to cover its simulated physical memory and there is something like VMWare’s memory balloons which eat up lots of memory temporarily to force cached pages to be thrown away. These require that you include the VMWare support in your virtual machine. That sort of situation could lead to thrashing on the host, even though the VM appeared to have plenty of memory.

As I said, both Linux and Windows try to make use of as much physical memory as they can, with only a small safety margin, so you should only allocate virtualise physical memory that can actually be backed by real physical memory.

I’ve seen some small ARM devices that also show this kind of behavior, though theoretically there should have been more than enough CPU power and RAM. It’s difficult to help, if there is nothing that one can refer to.

Your question cannot be answered based on the lack of details. You need to make use of your freedom to explore your entire environment to find out more about the possible cause. Since your problem does not show up in every second comment here, it is fairly safe to assume that there is no general Asterisk bug here.

Since you are obviously a Dostoevsky fan let me answer with a parable from The Brothers Karamazov. Here’s nobody strong enough to take on the burden of freedom for everybody else and nobody -not even Wikipedia- can give simple answers to all of your questions so you can happily live in ignorance.

Memory that is not immediately needed will get cached eventually so that the overall system performance increases. If that’s not the case, you need to look the overall setup.

In no case!

How can I be a fan of a man who in his youth was a fighter for freedom and democracy, was convicted for reading a letter from a famous critic to a famous writer in a circle of intellectuals, broke morally during imprisonment and returned to freedom already completely agreeing with his jailers?
Then he wrote works in which he described people with various severe moral and mental defects, enjoying a detailed understanding of their circumstances. At the same time, he himself was a gloomy misanthrope, suffered from several neuro-psychiatric diseases and gambling addiction.
In other words, Dostoevsky is also a character in Dostoevsky’s novel.

He even died of a severe fit of fear when he learned that the gendarmes had arrested the hiding revolutionary Barannikov in a neighboring apartment. Dostoevsky considered that he could be condemned again, in view of his past. A severe panic attack awakened a number of somatic diseases and Dostoevsky died of pulmonary hemorrhage.

Do you want to be a fan of such a person?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.