You are not logged in.
Pages: 1
Hi!
I've got a small question about the swap partition.
I've got a pretty descent computeur with 4Go DDR3 ram ( not noname and 12800 ).
I've not create a swap partition... Could it be a problem ?
I'm not sure to post on the right forum, but it's pretty related to installation...
Last edited by Thom (2012-09-29 17:43:15)
Offline
Without a swap partition if your computer runs out of RAM then the kernel will begin to randomly kill process' to free RAM. As long as every application, especially when all loaded at the same time, will stay within the 4GB RAM of your computer then you do not need a swap partition. However, if you have a larger hard drive then having one wouldn't hurt at all. The possible issue is that if you do not set up one when you initially install Arch then it may be complicated to do so later on it you find out that your 4GB RAM is inadequate.
I have 4GB of RAM and a 1TB hard drive. My partition layout is:
200GB Ext4 /
8GB Swap Swap
Rest of Drive Ext4 /home
I'd make a swap partition, simpler to do it at the start.
Last edited by headkase (2012-09-29 17:52:04)
Offline
You're not the first person to ask this question.
Offline
The possible issue is that if you do not set up one when you initially install Arch then it may be complicated to do so later on it you find out that your 4GB RAM is inadequate.
I have actually seen numerous reports of people successfully using a swap file. With the instructions in our glorious wiki, it is supposedly pretty easy.
Offline
I don't even need swap for my 2 GB Laptop with Gnome Desktop and serveral chromium tabs on x86_64. Highest it will ever go is 50-60%. A swap partition is pretty dumb it only wastes space and is not a flexible as a swap file which can be removed and created with just a handful of commands at anytime.
Offline
headkase wrote:The possible issue is that if you do not set up one when you initially install Arch then it may be complicated to do so later on it you find out that your 4GB RAM is inadequate.
I have actually seen numerous reports of people successfully using a swap file. With the instructions in our glorious wiki, it is supposedly pretty easy.
Sorry for the confusion, I meant that if you didn't create a swap partition when you initially installed Arch and wanted one later then you would have to muck around with the partition table at that time. Doing that, while fairly simple, would have a few possible points of failure. But, yeah, that's what I meant.
Last edited by headkase (2012-09-29 19:31:54)
Offline
Thanks for all the advices.
I don't create one because I was on a 60go hdd. I've receive my new hdd so the storage won't be a problem anymore.
I will try to follow the wiki and let you know if I've got a problem.
Offline
This interests me. As far as I know I've never used the swap space that I've setup. Maybe the next time a setup a Linux installation I'll just skip th swap partition.
Does anyone know what would happen if I had no swap partition and accidentally put Linux into hibernation, saving the current state of RAM to a "swap partition" that doesn't exist? I ask because I used to use an operating system that, when hibernating, would save to a special RAM-sized partition, and if that partition didn't exist, then the partition with the operating system didn't exist the next time I started the computer.
Offline
I think it would just fail to hibernate, and would no nothing.
Offline
4G of RAM should be fine. Ya, swap files seem cool and more flexable. I have not used a swap parition for a vary long time. One thing you will need though is some kind of memory monitor on your desktop, so you can keep an eye on things. One time, like a year ago, a program I was running had a memory leak. Then my computer started giving loads of errors. I think I had to hard-reboot, but all was find after the reboot and tracking down the memory leaking program.
It is worth noting that the bad memory leak would have resulted in the same thing even with a swap parition. It just would have taken, I guess twice as long.
Last edited by hunterthomson (2012-10-04 06:02:20)
OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec
Offline
Is it a big deal to dedicate 4 gb for swap? It will not slow down your pc if you have enough free memory, anyway.
I use system with 6 GB of memory. My usecases are browsing with firefox (with no disk cache and enlarged memory cache), development in eclipse, running jenkins, tomcat, etc.. Moreover, I always download files up to 1.5 GB directly into ram (/dev/shm) to reduce disk thrash. And only few times system began to swap. However it was nice that I experienced only notable slowdown but didn't lost any of my running applications. So I would go with a swap partition enabled.
Offline
eDio: instead of downloading to /dev/shm you can just mount your Downloads directory to a tmpfs like I do.
/etc/fstab
# Mount the downloads folder in to a tempfs
tmpfs /home/user/Downloads tmpfs rw,nodev,noatime,nodiratime,noexec,nosuid,uid=1000,gid=100,mode=700,size=10G 0 0
Last edited by hunterthomson (2012-10-04 07:48:28)
OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec
Offline
I've read some post 6-8 years ago about not using a swap partition. It was definitely not recommended to leave out a swap partition.
However, I've been running without swap for a few years now and I've never encountered problems. On the other hand, most systems come with 500GB or larger disks so you can easily miss 4-10GB for swap space.
Offline
I'd say this really depends on preferences and how one uses his/her box and what they do with it. Personally though I've never really needed any swap and nowadays, with the huge amounts of physical RAM (in my case 8 gig), I wouldn't bother setting up a swap partition anymore. A swap file should do the trick just fine. And the maximum I'd allocate for swap would be 1 GB.
Offline
I'll say dedicating more than 1 or 2GB for swap is a waste. If you need an application that requires lots of additional RAM than what you have, it will only run extremely slow using swap, so you're better off buying more RAM.
On the other hand, I have an SSD and disk space is very precious for me, plus the laptop has 8GB of RAM, so I use no swap.
Using something like "vm.swappiness = 10" in /etc/sysctl.conf I've not seen the need for swap in the last 5 or 6 years, even on computers with 1GB RAM.
Last edited by glock24 (2012-10-05 14:25:41)
Offline
I use a swap partition slightly bigger than my 4gb of ram, so hibernate will work. I have a large harddrive with lots of free space so space isn't an issue.
Offline
I have 8Gb of RAM in my PC. The only time I have run over 4 was when compiling android on it, then it ate all 8Gb and into probably 3 of my swap. Unless you are doing a lot of compiling or really heavy usage, I would say you are fine without it.
Offline
You can also try:
https://aur.archlinux.org/packages.php?ID=52958
From AUR.
sudo sytemctl enable zramswap.service
I use it with my laptop:
Every 1,0s: toybox Mon Nov 26 17:39:59 2012
total used free shared buffers cached
Mem: 372 362 10 0 10 103
-/+ buffers/cache: 248 124
Swap: 1396 71 1325
Filename Type Size Used Priority
/swapfile file 1048572 0 -1
/dev/zram0 partition 381916 72840 100
cpu MHz : 500.040
S.ficheros Tamao Usados Disp Uso% Montado en
rootfs 37G 15G 21G 41% /
dev 185M 0 185M 0% /dev
run 187M 268K 187M 1% /run
/dev/sda1 37G 15G 21G 41% /
tmpfs 187M 76K 187M 1% /dev/shm
tmpfs 187M 0 187M 0% /sys/fs/cgroup
tmpfs 187M 92K 187M 1% /tmp
/dev/fd0 1,4M 399K 1,1M 29% /run/media/ismaelvc/disk
acpitz-virtual-0
Adapter: Virtual device
temp1: +49.0C (crit = +84.0C)
via686a-isa-6800
Adapter: ISA adapter
Vcore: +0.06 V (min = +3.00 V, max = +3.10 V) ALARM
in1: +0.06 V (min = +3.07 V, max = +1.38 V) ALARM
+3.3V: +3.31 V (min = +0.96 V, max = +3.63 V)
+5V: +3.25 V (min = +6.44 V, max = +6.34 V) ALARM
+12V: +7.87 V (min = +15.54 V, max = +13.62 V) ALARM
fan1: 0 RPM (min = 3026 RPM, div = 2)
fan2: 0 RPM (min = 0 RPM, div = 2)
temp1: +24.1C (high = +146.2C, hyst = +23.2C)
temp2: +24.4C (high = +146.2C, hyst = +54.4C)
temp3: +25.3C (high = +146.2C, hyst = +49.7C)
Its a amd duron 1100, I don't know how fast the HDD is, but zramswap is supposed to be faster than swaping to HDD, I have had no problems its a 10 year old laptop runing MATE (vaio / ati mach64).
Laptop: LG LM70 Express Kernel: 3.14.2-1-ARCH
CPU: Intel Pentium M processor @1.86GHz Hard Drive: 80G
Video: Mobility Radeon X600 X Driver: xf86-video-ati
Memory Size: 1.5G + zramswap: 384M + swap: 3G
Offline
I think this is entirely dependent on what you use the computer and not just the amount of RAM you have. I still create a swap partition even although I have 16 gigs of RAM. I'm not sure what would happen if I had no swap but on occasions I end up using swap because I do graphics and sometimes I push things too far. When it goes to swap I stop whatever process is causing it.
Offline
^ what Ryan said,
It's mostly dependent on what you use the computer for...I have 4GB of RAM and don't use a swap partition, and rarely hit above 2GB with programs running on 7 virtual desktops...if you are using heavy graphics, it might be useful. Aside from that, put a counter in your toolbar so you can see it and create one if you hit > 3GB consistently.
The obvious reason is if you need to hibernate. And for the record, I think depending on your 'swappiness' a swap partition/file CAN slow down your computer because you are using swap and not RAM in some cases....although the measure of that slowdown is probably insignificant.
I think unless you're doing graphics or heavy compiling or some other memory hungry app (CAD, PhotoShop, video editing whatever) don't bother.
Offline
Pages: 1