Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
08-20-2003, 08:59 AM
|
#1
|
Member
Registered: Mar 2002
Location: malaysia
Distribution: Mandriva 2006 RC1
Posts: 486
Rep:
|
why does linux need swap file?
for what?
|
|
|
08-20-2003, 09:14 AM
|
#2
|
Member
Registered: Aug 2003
Location: Belgium
Distribution: Debian (server), Kubuntu (desktop)
Posts: 248
Rep:
|
|
|
|
08-20-2003, 10:23 AM
|
#3
|
Member
Registered: Aug 2003
Location: North Carolina, USA
Distribution: Onebase 2004-r2 | Updated through 6-10-04
Posts: 359
Rep:
|
to encrease size of memory, and to free up the on borad memory, which makes programs run a little faster.
|
|
|
08-20-2003, 10:51 AM
|
#4
|
Member
Registered: Dec 2002
Location: IL
Distribution: NetBSD, Slackware, Gentoo, Debian, FreeBSD
Posts: 444
Rep:
|
All operating systems use a swap file. There may be a few that don't, not 100% sure.
You can choose to run linux without a swap if you want to. Having at least 512MB of ram should be good enough to skip a swap.
|
|
|
08-20-2003, 10:55 AM
|
#5
|
Member
Registered: Jul 2003
Location: London
Posts: 548
Rep:
|
It's also historical in that it all started when there wasn't enough RAM to run what was necessary, I think [although I'm not sure]. As wr3ck3d says, it is not ultimately necessary to have a swap file, however I would strongly recommend it, as some things tend to much up [such as the original installation] when you don't have a swap file.
|
|
|
08-20-2003, 12:02 PM
|
#6
|
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113
Rep: 
|
I've always been a minimal-swap advocate but I entered the DVD age finally last night and *that* eats some RAM. Still, it was mostly being cached and didn't dip into my swap too much for as much as I observed it and that was Linux's usual pre-emptive memory usage. I *might* have gotten by without a swap.
Actually, wr3ck3d, DOS doesn't use swap.  DOS apps do create temp files all over the place but the system doesn't have a permanent swap file or partition. And I'm pretty sure most temp files are more to get around single-tasking limitations than low-mem limitations. And it's not just cuz DOS is lame - Linux (on average) uses a fraction of RAM in CLI that it uses in GUI.
But, yeah, long story short, swap's cheap additional (virtual) RAM.
And I don't know what the guy who wrote that Solaris thing was talking about regarding Linux. With top alone, at the bottom of the very man page is
free(1), ps(1), uptime(1), vmstat(8), w(1).
and free, ps, and vmstat, at the least, are relevant. And I'm sure that's not all.
|
|
|
08-20-2003, 09:45 PM
|
#7
|
Member
Registered: Aug 2003
Location: france
Distribution: suse/fedora
Posts: 105
Rep:
|
it needs swap for running on old machines.
i have used both linux + windows (3.11) without swap which worked fine, but w98 flips without swap, and on a 512meg machine my linux was'nt happy. It may be that its used to catch memory leaks, but perhaps this is better discussed on a linux kernel writers forum, its a bit in-depth.
|
|
|
08-20-2003, 09:57 PM
|
#8
|
LQ Guru
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163
Rep:
|
Swap is like using a small part of the hard drive to store information you may need quick somewhere else that in RAM (cuz in older time, RAM memory was a precious thing). So Linux doesn't have to search for these information on all the hard drive, they are stored and ordered in swap space... it is not very usefull these days because most computer have above 256 MB, but it may help, sometime.
|
|
|
08-20-2003, 10:53 PM
|
#9
|
Senior Member
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918
Rep: 
|
Quote:
why does linux need swap file?
|
You are not under the impression that Windows does not have a swap file by default are you?
Linux installations tend to prefer swap partitions. Before I ever had Linux on my computer I had read people advocate using a swap partition on Windows rather than the default swap file to increase speed. It did not seem odd to me that Linux asked for this on install. It is also possible to create a swap file for Linux if you choose.
There are already some good explanations for the why.
|
|
|
All times are GMT -5. The time now is 03:48 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|