Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
At some point in time my VMs exceeded the 5.8GB limit and overflowed into swap (all dev VMs). I have since shut down the VMs and restarted Firefox (memory hog).
Right now I have 0.73GB in RAM and 0.29GB in swap. I want to move all of the data in swap into RAM where it will be faster. So I will end up with 1.02GB in RAM and 0GB in swap.
Is there a quick command to move data contained within swap to RAM? I know of the swapon/swapoff command. I was wondering if there was another method which clears swap.
man free says "free - Display amount of free and used memory in the system". It only displays information. This doesn't free swap at all. Not sure where you're going with that. If it is capable of being my solution then care to emphasize?
I modified my question a little and bolded it. Perhaps you didn't understand my original question.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
if you are using swap then chances are its because you ram is full, wanna pull stuff out of swap? probably the best way to do that is to get more ram, swap is not like a regular hard drive partition that will eventually get full and need wiping it is constantly being written, over-written and erased as it is used.
Are you talking about the host RAM/swap ?.
There is no sensible alternative to swap{off,on} - why do you not want to use it ?. It's quick, and it works. If there is insufficient RAM to hold all the swap resident pages, the swapoff fails, no damage done.
I suspect you aren't actually using that swap anyway - Linux uses lazy deallocation, and the pages will only be reclaimed (and flags cleared) if needed. So they'll (probably) already be unused, but stale.
Well I tried the swapoff command but it doesn't work with no arguments. I just have to look up how it's formatted. I just wondered if there was a one shot deal which moved swap data into RAM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.