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 have 2G of physical memory and 1G of memory swap. Very rarely the memory swap is used and when usage is around 1% while, then gets a lot of free physical memory...
My question is:
It is possible to "clean up" the memory swap. Or better still (I think). It is possible to spend
physical memory for data that is in memory swap?
I use swappiness in a vice-versa way to your needs as I have old hardware on some boxes.
Currently set swappiness to 95 (0-100) on 256MB and system is much more repsonsive.
(0 - 100) == 0 never use swap;
You might want to try swap off as above post or swappiness 05 (0-100) - maybe -
or with your hardware even swappiness of 01.
For on-the-fly - Use:
Does not stay after a reboot;
Code:
sysctl -w vm.swappiness=05
I would test swappiness first 'on-the-fly' then with successful testing and to make permanent after reboots with;
Code:
cp /etc/sysctl.conf /etc/sysctl.conf_ORIGINAL
if you already have a 'sysctl.conf'
then change the last line below in /etc/sysctl.conf
Code:
# as root use
# 'cat /proc/sys/vm/swappiness'
# to view system swappiness
###
# default is 60
###
# as root use
# 'sysctl -w vm.swappiness=10'
# to change the swappiness on the fly
###
# change the following decimal integer
# 0 - 100 where 0 is NEVER use swap - not an altogether fantastic idea!!!
vm.swappiness=05
I agree with 'evo2':
I don't really understand why you want to do this though.
..more effort required than increased performance with your hardware..
Last edited by dh2k; 05-12-2010 at 12:49 PM.
Reason: TYPO
My question is:
It is possible to "clean up" the memory swap. Or better still (I think). It is possible to spend
physical memory for data that is in memory swap?
let me know ...
many thanks
In a nut shell, - Yes it is - is it worth it? - well, we'll put our own value on that I guess - for learning - a defo yes.
Right now I'm out of time to provide feedback. My understanding of English is poor and time consuming in my case ...
I am very interested in the answer!
I have a case with 700M of memory and another with 2G. The first, when I use KDE
quicker to swap memory is used and pc is slow ... In the second case (2G) happens
to get the memory swap around 1% (which does not change the performace)
Right now I'm out of time to provide feedback. My understanding of English is poor and time consuming in my case ...
I am very interested in the answer!
I have a case with 700M of memory and another with 2G. The first, when I use KDE
quicker to swap memory is used and pc is slow ... In the second case (2G) happens
to get the memory swap around 1% (which does not change the performace)
Thank you very much
ps: I use very Google translator
OK.
In general, Linux will move a program's memory to swap space if it believes that the program hasn't been doing anything useful in a period of time.
For instance, if I were to launch Netbeans and then minimize the window that comes up, then after a period of time the operating system (OS) would decide to save all the Netbeans state to swap so that other programs could use the RAM for whatever I was really doing.
If I were to bring up the Netbeans window, I would have to wait whilst the SO loaded all the Netbeans pages from swap.
In general, Linux will move a program's memory to swap space if it believes that the program hasn't been doing anything useful in a period of time.
For instance, if I were to launch Netbeans and then minimize the window that comes up, then after a period of time the operating system (OS) would decide to save all the Netbeans state to swap so that other programs could use the RAM for whatever I was really doing.
If I were to bring up the Netbeans window, I would have to wait whilst the SO loaded all the Netbeans pages from swap.
Please
In your example with the minimized program, I type
swapoff -a && swapon -a (answered by EVO2 up ,thanks )
what happens with the program? The system is "smart" enough to save the data?
This all seems pointless if you don't understand the functions and workings of the paging system.
Swapoff forces all pages back into backing RAM. If there is insufficient the swapoff fails, an the swap extent remains in use.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.