Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
My machine has 24 GB of memory and runs CentOS 6.4 64-bit. I'm having problems using /dev/shm. I think this is because the disk cache is filling up (see previous thread). I don't know how to fix it, but if I limit the disk cache size, then that's might work.
Does anyone know how to limit the size of the disk cache?
I don't want to change the size of /dev/shm. I want to change the size of the disk cache. Why? Because the disk cache is getting too large and that is taking space away from /dev/shm. That prevents me from being able to use /dev/shm (and it prevents other apps from using /dev/shm, and those apps are crashing).
How can I decrease the size of the disk cache?
Or, how can I prevent the disk cache taking space away from /dev/shm? I know that the disk cache is not supposed to take space away from other applications. Maybe this is true. But it is certainly taking space away from /dev/shm. So the disk cache is effectively taking memory space away from other applications. Thank you.
Are you asking about memory cache ( ram ) or hard drive cache memory (swap)?
I'm not sure (newbie). I'm asking about the cache which is reported in /proc/meminfo on the fourth line which begins with 'Cached:'. As this number grows, the available space I can use in /dev/shm decreases, and this causes my app (which uses /dev/shm for tmp files) to fail.
Yes, I think that will work for me. I will try it later. However, can you think of a reason why this cache isn't automatically free'ed as I copy files into /dev/shm? For 3 years, on this machine, this worked fine. But for some reason, about a month ago, the memory cache seems to be preventing me from using /dev/shm, and this is causing all sorts of problems. Could I have inadvertently changed something which altered this behavior?
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2
I'm asking about the cache which is reported in /proc/meminfo
That is what is in ram, not the hard drive. The sync command as indicated in post #5 can reduce the number of buffers and cache. BTW, you can see the buffers and cache dynamically with the top command.
There are parameters in the kernel config that have an affect on buffers and cache.
Could I have inadvertently changed something which altered this behavior?
I believe a kernel upgrade could have had some effect on this. That would take some investigating.
I had a problem recently with /dev/shm in memory. I had problems compiling an application. The work around was to mount temp file space on a real hard drive partition, with adequate space. Once done, the app compiled. This is not an ideal solution for the long term though, since disk access is much slower than memory access.
Okay, then forget disk cache. I think my issue is with the memory cache. The problem seems to be that when the memory cache gets close to the total size of physical memory, I can no longer use /dev/shm.
I did not upgrade the kernel recently, so that could not have caused this problem.
This problem started about a month ago about the time I configured a software RAID with mdadm. Is it possible I changed something that caused the memory cache to behavior differently? I looked at every file in the
/etc directory tree that changed during the past month. No files changed which had anything to do with the disk (other than possibly the mdadm config file).
Where would be a good place to look for answers to this? I really need to be able to use /dev/shm.