Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The cache _should_ be full - it's a RAM cache of recently read filesystem data. If that memory is needed by an application, part of the cache will be freed and handed over.
Take a look at the 'free' output - the '-/+ buffers/cache' line is what you should be looking at.
The cache _should_ be full - it's a RAM cache of recently read filesystem data. If that memory is needed by an application, part of the cache will be freed and handed over.
Take a look at the 'free' output - the '-/+ buffers/cache' line is what you should be looking at.
All is well.
Dave
I agree ilikejam, but still customer wants to know the reason for only the cache memory being utilized. There is NO such application using the cache memory.
What I need is the way to flush cache memory (without rebooting the server)
No application is using the cache. The kernel will free the cache when there is need of memory or request for memory.
Thats how Linux kernel works. You could do stuff like memstress or something like that and you will see that the cache is being released. It doesn't matter anyways, because there is no danger and you have memory to use, just the kernel doesn't show you that
Tell the customer that dropping the caches will cause a pretty considerable degradation in performance (which it will), and that they don't want to do this. Keep telling them this until they understand.
Like ilikejam & robertjinx are telling you, Linux automatically caches as much as it can. There's no point in having empty memory. If it needs that mem, it'll adjust the caches as needed. That's what the vm part of the kernel does for you. Tell the customer to ignore it and keep telling him...
Quote:
To make the most efficient use of real memory, Linux automatically uses all free RAM for buffer cache, but also automatically makes the cache smaller when programs need more memory.
No application is using the cache. The kernel will free the cache when there is need of memory or request for memory.
Thats how Linux kernel works. You could do stuff like memstress or something like that and you will see that the cache is being released. It doesn't matter anyways, because there is no danger and you have memory to use, just the kernel doesn't show you that
Hi Robert,
Could you please explain what can be done in memstress ?
I have communicated to the customer, just for sake of my knowledge.
The memstress will eat up the memory, more as a bench mark to see if the kernel will handle it, but in the same time... as it eats all the memory, after stoping the script it will free up everything, as its not in use anymore... I dont know much about the logic inside it, meaning how the kernel does this, but just test it on the devel system and you will see the results.
Sorry, I didnt added the memstress script here:
[PHP]
#!/bin/bash
uprog ()
{
sleep 60
}
count=0
while [ "$count" -lt 10000000 ] ; do
uprog &
echo $count
clear
count=`expr $count + 1`
done
/[PHP]
Last edited by robertjinx; 03-05-2009 at 03:45 AM.
[QUOTE=robertjinx;3465535]The memstress will eat up the memory, more as a bench mark to see if the kernel will handle it, but in the same time... as it eats all the memory, after stoping the script it will free up everything, as its not in use anymore... I dont know much about the logic inside it, meaning how the kernel does this, but just test it on the devel system and you will see the results.
The memstress will eat up the memory, more as a bench mark to see if the kernel will handle it, but in the same time... as it eats all the memory, after stoping the script it will free up everything, as its not in use anymore... I dont know much about the logic inside it, meaning how the kernel does this, but just test it on the devel system and you will see the results.
Sorry, I didnt added the memstress script here:
PHP Code:
#!/bin/bash
uprog () { sleep 60
}
count=0
while [ "$count" -lt 10000000 ] ; do
uprog & echo $count clear count=`expr $count + 1`
done
Thanks Robert. This script, reduces that cache BUT it eats up the swap memory, more over when I tried rebooting the server it was throwing some fatal errors.
Anyways, now I can explain them a little more about the issue.
It suppose to eat all the memory and when there is no memory left start with the swap... but it shouldn't kill the system, if everything is ok. I tested my own system with this and never happened a crash... also try to keep the script until it reaches like 3000 or so and Ctrl+C and you will start to see a decrees of memory usage and cache is freeing up, but its temporary until the kernel will start again caching the memory. Like all the guys said before, the Linux kernel works this way, if you client or whatever needs to know "Why?" take a tour of the Linux kernel, how it does the memory management and I think it will be explained there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.