Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with 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.
hello!
i have a laptop with 3 gigs of (admittedly very slow) Ram and i partitioned in 6 gigs of Swap space to my hard disk.
my question is that my laptop rarely gets above 50% RAM and i have yet to see it with anything in swap so is it possible to manually make linux load certain programs into ram/swap on startup? is there something useful i should be doing with all that swap? (i am not exactly pushed for harddrive space
Why do you want to load programs from RAM (fast) to disk (slow)? That makes no sense to me.
Also I think that 6GB is far to large, what applications do you run on that system? If you hardly ever use swap, and your RAM is almost always at 50% I would reduce that to 1GB and use the rest for other purposes.
You've got plenty of RAM, more than plenty of swap, and hard disk space to spare. So... where's the problem?
If you think your RAM is slow, wait until you start running things out of swap. The purpose of swap space is to be an overflow area if you start maxing out your RAM, but you take a severe performance hit to use it. RAM is accessed at CPU clock speed, and disk access has to wait for head seek, and be clocked across a slower interface. Rejoice that your swap is going unused.
If anything, the tuning opportunity presented here is to reduce swap and reclaim some disk space... but since you're not constrained for disk space, I wouldn't worry about it.
I agree with the others that a 6 GB ram is useless when your system always has at least 1.5GB of free ram.
I also agree that it's not a big deal, and can wait until the next time you install Linux.
Now, what you can do with your extra ram, is create a filesystem in RAM. if you do things like video encoding using multiple passes, you would store the intermediate files in that ram filesystem.
Something else you may be able to do is pre load some files in RAM for future use (openoffice, firefox, etc ...). I'll let someon else answer here as i don't know how it's done
Here's an article on the subject. It's interesting to note that Andrew Morton sets his workstation's swappiness to 100. Personally, I go for 30-40 or the 'standard' 60.
I simply allocate 1.5 times as much swap-space as my system has RAM, and leave the swap-tendency values at their default values.
I want the system to have somewhere to go, if it starts running short of available space in RAM, because the only alternative that the system has is to start killing processes. But under ordinary circumstances, these days, the system should not have to resort to swapping at all. To my way of thinking, "dirty pages" can stick around in RAM as long as they care to, until and unless some actual memory pressure moves them aside.
sorry guys i think you misunderstood: i do NOT want to move things from RAM to swap as that would obviously be completely stupid
however; it is my understanding that A) swap is regarded as a baaad thing when actually it is very useful (but i dont know what for other than when ram is full)
and B) that Linux "aggressively swaps to disk" which it never seems to
what i want to know is if i can tell my computer to load programs like firefox into RAM, in a sort of ready state, and if the swap could be used to speed things up
That would be cool, bad sadly we don't have RAM at this speed yet.
Quote:
what i want to know is if i can tell my computer to load programs like firefox into RAM, in a sort of ready state, and if the swap could be used to speed things up
This can be done, but you don't need swap for it. Would be useless with swap, why should a loding from swap (disk) should be faster than from filesystem (disk)?
Have a look at the programs preload and prelink, I think they do what you want to achieve.
and B) that Linux "aggressively swaps to disk" which it never seems to
Actually, it's the opposite-- Windows swaps aggressively to "save" system resources, although I've yet to understand exactly for what. Linux, on the other hand, uses system resources for faster, smoother program flow, and swaps as a last resort.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.