SlackwareThis Forum is for the discussion of Slackware Linux.
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.
I am running slackware 13 with fvwm. I have 4gb of RAM (although the system sees less as I am using shared graphics - I don't need anything better! ) Now, when I boot up, if I run vmstat, I get about 100M RAM used and the rest free.
After starting X, that goes up to about 200/250M RAM used (which is fine).
However, after the machine has been up and running for the day and I have been doing various things (mostly just browsing and the odd bit of text editing here and there, nothing out of the ordinary), I run vmstat and it is showing 1100M of RAM in use! Now, I obviously still have plenty left to play with, but what the hell is eating up the extra 800M of ram that I had when I started up?!?
Running "top" shows nothing obvious - most processes are just marked at 0% or memory, and the odd one which isn't is less than 1%.
I am assuming therefore there is something which is leaking memory somewhere!
Is there any way to maybe trace this and see what is doing it? I have a suspicion that it may be firefox but that's just a hunch.
I bet if you flush the cache it will all magically reappear. RAM gets cached and to the novice (myself) appears to being all used.
Flush RAM
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
Would you know it, it has all re-appeared after running the above!
So, are you saying then that it is not actually being used, it just appears to be as it is cached? Could one assume that if it was needed then the cache would be automatically flushed by the system?
I am running slackware 13 with fvwm. I have 4gb of RAM (although the system sees less as I am using shared graphics - I don't need anything better! ) Now, when I boot up, if I run vmstat, I get about 100M RAM used and the rest free.
After starting X, that goes up to about 200/250M RAM used (which is fine).
However, after the machine has been up and running for the day and I have been doing various things (mostly just browsing and the odd bit of text editing here and there, nothing out of the ordinary), I run vmstat and it is showing 1100M of RAM in use! Now, I obviously still have plenty left to play with, but what the hell is eating up the extra 800M of ram that I had when I started up?!?
Running "top" shows nothing obvious - most processes are just marked at 0% or memory, and the odd one which isn't is less than 1%.
I am assuming therefore there is something which is leaking memory somewhere!
Is there any way to maybe trace this and see what is doing it? I have a suspicion that it may be firefox but that's just a hunch.
Cheers!
Install htop and that will give you a table of per-process resource consumption in a neat ncurses interface.
Look at the memory bar: there will be the green section showing memory use by the current running processes and the orange section showing the total memory use including the kernel caches.
It is odd how often this, or a variant of the confusion caused by it comes up.
Quote:
Originally Posted by devnull10
So, are you saying then that it is not actually being used, it just appears to be as it is cached?
It is actually being used, but it is being used as a cache for items that otherwise would have to be retrieved from disk. So, this arrangement speeds up your system overall, even if you cannot see which of your activities has caused the use.
Quote:
Could one assume that if it was needed then the cache would be automatically flushed by the system?
The system only uses otherwise unused memory for this, so, essentially yes.
It might be a concern if you thought that this was going to cause your memory to wear out prematurely, but, for RAM at least, this isn't the case.
BTW, vmstat showed a 'cached' entry and a 'buff' entry, and you looked at vmstat earlier; did you notice those? And thanks to SqdnGuns for the interesting approach of 'scripting' a flush of the memory; I hadn't though of that, and it can be used to demonstrate the point.
Hi,
Thanks for that, it has cleared up a bit of confusion!
I created a little fvwmscript to display RAM usage (as I didn't like the look of any of the existing ones out there - I wanted something very simple!) which takes the output of "vmstat -s -S M" and uses it to print to a docked window.
I guess it would be worth modifying this to display the "active memory" rather than the "used memory" field? What is the "inactive memory" field representing?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.