Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Linux swap necessary?
New Posts  All Forums:Forum Nav:

Linux swap necessary? - Page 2

post #11 of 31
this depends on you and what you do on the pc

i have installed ubuntu and mandriva since old days with 512mb ram without pagefile (swap), never had issues, but i do only basic stuff on linux

the same goes for windows, no pagefile for me, the only game that crashed for me was cod mw2
pote reload
(14 items)
 
  
CPUMotherboardGraphicsRAM
intel 3570k@4.4@1.25 gigabyte z77z-ud3h gigabyte gtx460 768mb oc 850/2100 8gb ddr3 1600 corair vengeance blue 
Hard DriveOptical DriveCoolingOS
samsung 500gb hd502hj, 2x crucial m4 64gb raid 0 sony optiarc 24x hyper 212+ win8 x64 
MonitorPowerCaseMouse
envision lcd wide 19 + lg tv lcds 32" 32ld330 1... corsair vx 550w cheapo steelseries ikari laser 
  hide details  
Reply
pote reload
(14 items)
 
  
CPUMotherboardGraphicsRAM
intel 3570k@4.4@1.25 gigabyte z77z-ud3h gigabyte gtx460 768mb oc 850/2100 8gb ddr3 1600 corair vengeance blue 
Hard DriveOptical DriveCoolingOS
samsung 500gb hd502hj, 2x crucial m4 64gb raid 0 sony optiarc 24x hyper 212+ win8 x64 
MonitorPowerCaseMouse
envision lcd wide 19 + lg tv lcds 32" 32ld330 1... corsair vx 550w cheapo steelseries ikari laser 
  hide details  
Reply
post #12 of 31
Windows will use a page file regardless of how much RAM is free. Linux does not. Linux uses SWAP when (and if) it is actually needed. If you plan to hibernate then you'll need at least as much SWAP as you have RAM, but otherwise put in something small and be done with it. You're unlikely to ever use even close to 8GB of RAM.
    
CPUMotherboardGraphicsRAM
i7 920 D0 MSI X58 Pro-E GTX 560 Ti 448 3x2GB G.Skill DDR3-1333 9-9-9-24 
Hard DriveHard DriveOptical DriveOS
840 Pro Caviar Black LG BD-ROM Windows 8.1 Pro x64 
MonitorMonitorKeyboardPower
Dell U2713HM Dell U2311H Turbo-Trak (Google it :D) Corsair HX-520 
CaseMouseMouse PadAudio
CM690 Mionix Avior 7000 Everglide Titan AKG K 242 HD 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
i7 920 D0 MSI X58 Pro-E GTX 560 Ti 448 3x2GB G.Skill DDR3-1333 9-9-9-24 
Hard DriveHard DriveOptical DriveOS
840 Pro Caviar Black LG BD-ROM Windows 8.1 Pro x64 
MonitorMonitorKeyboardPower
Dell U2713HM Dell U2311H Turbo-Trak (Google it :D) Corsair HX-520 
CaseMouseMouse PadAudio
CM690 Mionix Avior 7000 Everglide Titan AKG K 242 HD 
  hide details  
Reply
post #13 of 31
Quote:
Originally Posted by Jimi View Post
It is required to have at least the amount of RAM you have in swap if you want to hibernate your computer.
this
OoGhiJ MIQtxxXA
(13 items)
 
  
CPUMotherboardGraphicsRAM
q9550 E0 @3.825ghz Abit IX48-GT3 Tigerforce SPARKLE GTX470 850c/1800m 220 650c sli later 4GB DDR3 Mushkin blackline 7-8-7-24-1T 1200mhz 
Hard DriveOptical DriveOSMonitor
WD1tb +WD500gb +WD200gb not like I need one edge linux LG 22" w2240 +optiquest q71 
KeyboardPowerCaseMouse
Adesso MKB-135B Mechanical DELTA GPS-750B A 750w sleeved moded Kandalf LCS Razer Mamba 
Mouse Pad
don't got one or need one 
  hide details  
Reply
OoGhiJ MIQtxxXA
(13 items)
 
  
CPUMotherboardGraphicsRAM
q9550 E0 @3.825ghz Abit IX48-GT3 Tigerforce SPARKLE GTX470 850c/1800m 220 650c sli later 4GB DDR3 Mushkin blackline 7-8-7-24-1T 1200mhz 
Hard DriveOptical DriveOSMonitor
WD1tb +WD500gb +WD200gb not like I need one edge linux LG 22" w2240 +optiquest q71 
KeyboardPowerCaseMouse
Adesso MKB-135B Mechanical DELTA GPS-750B A 750w sleeved moded Kandalf LCS Razer Mamba 
Mouse Pad
don't got one or need one 
  hide details  
Reply
post #14 of 31
Greetz
Obviously if you hibernate you must choose your ram amount for swap. Excepting that 200MB is plenty. I run KDE with lots of processes and open windows (280 processes is avg) and I only have 2GB ram. My swap is almost never used and max ever was 67 MB. I have a laptop with 512MB and use a 300MB swap. Never a problem.
NewMain
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 - 3550 Asrock Z77 Extreme4 Gigabyte GTX 760  4x2GB Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Seagate SATA 2TB x 2  Plextor PX-891SAW CM-Hyper N520 Slackware 14, Studio KUbuntu, OpenSuSe 12.3, Wi... 
MonitorKeyboardPowerCase
32" Vizio HDTV + DLP Logitech Wireless Corsair HX-850 Antec Sonata I 
MouseMouse PadAudioOther
Razer DeathAdder 2013 dual ESI Juli@ CoolGear ExtSata Enclosure w/ Optical and 3TB S... 
  hide details  
Reply
NewMain
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 - 3550 Asrock Z77 Extreme4 Gigabyte GTX 760  4x2GB Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Seagate SATA 2TB x 2  Plextor PX-891SAW CM-Hyper N520 Slackware 14, Studio KUbuntu, OpenSuSe 12.3, Wi... 
MonitorKeyboardPowerCase
32" Vizio HDTV + DLP Logitech Wireless Corsair HX-850 Antec Sonata I 
MouseMouse PadAudioOther
Razer DeathAdder 2013 dual ESI Juli@ CoolGear ExtSata Enclosure w/ Optical and 3TB S... 
  hide details  
Reply
post #15 of 31
With an SSD card: no swap. Never. It's pointless.

Create a RAMdisk using /dev/shm as well, and make a RAMdisk that mounts to /tmp. This will allow you to compile to /tmp (RAM) instead of your SSD.

Swap will NEVER be used unless you're running a large virtual machine as well as a bunch of other programs on the host OS. I've tested this myself and found that I only used 2 MB of swap.


you should also change the 'swappiness' parameter on the kernel. I'm a bit drunk now so a quick google should give you the results You basically echo 1 to swappiness (default is 60 in the current kernel).

Swappiness is a hot debate amonst kernel devs ATM.

TL;DR

DO NOT USE SWAP ON AN SSD. If you REALLY think you need it buy a cheap USB drive and create a swap partition there.

I would suggest using suspend to RAM, but if you must use hibernate then buy a cheap 8GB flash drive, create a swap partition, activate the swap, then add it to fstab.

Also you might want to mount an old hard drive to your Torrents/Downloads folder to prevent excessive read/write.


You should really use suspend to ram using pm-utils to suspend to RAM. Swap should NOT be used on an SSD. Ever. I can't stress this enough. The number of writes is just not worth it.
Edited by binormalkilla - 12/18/10 at 11:48pm
PWNzershreck
(15 items)
 
  
CPUMotherboardGraphicsRAM
4930K @ 4.6 GHz ASUS Rampage IV Black Edition MSI GTX 1080 FE Heatkiller Acetal 16 GB Corsair Vengeance 1600C9 
Hard DriveOptical DriveCoolingOS
2x Samsung 840 Pro  ASUS DVD-RW SATA Koolance 380i & 2x HW Labs 480GTX Arch Linux x86_64, Windows 7 x64 
MonitorKeyboardPowerCase
LG UC88-B Ultrawide, ASUS VS278Q Ducky Corsair AX1200i Caselabs STH10 
MouseMouse PadAudio
Logitech G500 Func 1030 ASUS Xonar Essence STX 
  hide details  
Reply
PWNzershreck
(15 items)
 
  
CPUMotherboardGraphicsRAM
4930K @ 4.6 GHz ASUS Rampage IV Black Edition MSI GTX 1080 FE Heatkiller Acetal 16 GB Corsair Vengeance 1600C9 
Hard DriveOptical DriveCoolingOS
2x Samsung 840 Pro  ASUS DVD-RW SATA Koolance 380i & 2x HW Labs 480GTX Arch Linux x86_64, Windows 7 x64 
MonitorKeyboardPowerCase
LG UC88-B Ultrawide, ASUS VS278Q Ducky Corsair AX1200i Caselabs STH10 
MouseMouse PadAudio
Logitech G500 Func 1030 ASUS Xonar Essence STX 
  hide details  
Reply
post #16 of 31
Quote:
Originally Posted by ZHoob2004 View Post
I remember someone asking this in my linux class, and afaik, it's best to run a system with a swap file equal in size to your ram, just to prevent any really bad system hangs under heavy load. If you never fill up your ram much though, I don't know how much it will be used since that is up to the kernel, but I don't think you should run without any swap at all.
That used to be the case before everyone had so much RAM (it used to be 2x your amount of RAM) and usually came out to be 1gig to 2gigs. Now it's still not necessary to go over that. I think I have a 1GB swap.


Quote:
Originally Posted by Jimi View Post
It is required to have at least the amount of RAM you have in swap if you want to hibernate your computer.
Mine hibernates fine with a 1GB swap.
Deimos
(13 items)
 
Pluto
(18 items)
 
 
CPUMotherboardGraphicsRAM
AMD 1090T Biostar TA890FXE Nvidia GTX 470 Corsair Vengence 
Hard DriveHard DriveHard DriveHard Drive
Samsung 830 MZ-7PC128D/AM Western Digital Black Western Digital Green Western Digital Blue 
CoolingOSOSMonitor
Dtek v2 Water Windows 7 Pro Fedora 16 LG4250 42" LCD TV 
KeyboardPowerCaseMouse
Microsoft Ergo Silverstone ST-1000P Cooler Master Cosmos 1000 Logitech G500 
Mouse PadAudio
X-Trac Ripper Asus D1 
  hide details  
Reply
Deimos
(13 items)
 
Pluto
(18 items)
 
 
CPUMotherboardGraphicsRAM
AMD 1090T Biostar TA890FXE Nvidia GTX 470 Corsair Vengence 
Hard DriveHard DriveHard DriveHard Drive
Samsung 830 MZ-7PC128D/AM Western Digital Black Western Digital Green Western Digital Blue 
CoolingOSOSMonitor
Dtek v2 Water Windows 7 Pro Fedora 16 LG4250 42" LCD TV 
KeyboardPowerCaseMouse
Microsoft Ergo Silverstone ST-1000P Cooler Master Cosmos 1000 Logitech G500 
Mouse PadAudio
X-Trac Ripper Asus D1 
  hide details  
Reply
post #17 of 31
This used to be a pet peeve of mine - the idea that swap should be directly proportional to RAM.. It should be inversely proportional since the more ram you have the less swap you need. Also huge amounts of swap are needed more for Windoze since it leaks so badly with all the unresolved prefetch and what-not. Besides, they have a vested interest in their hardware partners so they can afford to be sloppy.

It is better to have more than to run out but the heaviest use I have ever seen on any machine by a user who did magazine layouts and web design professionally was still under 2Gigs on a Win2K machine. I have never seen any Linux install (other than an overworked server with 40+ workstations) use even 2Gig. ever. Home systems? Less than 1G tops.
NewMain
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 - 3550 Asrock Z77 Extreme4 Gigabyte GTX 760  4x2GB Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Seagate SATA 2TB x 2  Plextor PX-891SAW CM-Hyper N520 Slackware 14, Studio KUbuntu, OpenSuSe 12.3, Wi... 
MonitorKeyboardPowerCase
32" Vizio HDTV + DLP Logitech Wireless Corsair HX-850 Antec Sonata I 
MouseMouse PadAudioOther
Razer DeathAdder 2013 dual ESI Juli@ CoolGear ExtSata Enclosure w/ Optical and 3TB S... 
  hide details  
Reply
NewMain
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 - 3550 Asrock Z77 Extreme4 Gigabyte GTX 760  4x2GB Corsair Vengeance 
Hard DriveOptical DriveCoolingOS
Seagate SATA 2TB x 2  Plextor PX-891SAW CM-Hyper N520 Slackware 14, Studio KUbuntu, OpenSuSe 12.3, Wi... 
MonitorKeyboardPowerCase
32" Vizio HDTV + DLP Logitech Wireless Corsair HX-850 Antec Sonata I 
MouseMouse PadAudioOther
Razer DeathAdder 2013 dual ESI Juli@ CoolGear ExtSata Enclosure w/ Optical and 3TB S... 
  hide details  
Reply
post #18 of 31
I always keep a 256MB swap just in case. You never know what you may be doing or what could eat up your ram, though I have never had an issue.
 
Gsvlip Dudyrm
(15 items)
 
Oda'maksv
(9 items)
 
CPUMotherboardGraphicsRAM
3770k @ 4.5 1.312 load Zotac Z77 ITX Wifi GTX 1070 Gaming 2126/2249 w/ Hybrid cooler TridentX 16GB 2400MHz 
Hard DriveHard DriveCoolingCooling
Samsung 850 Pro 1TB Seagate 2TB H105 EVGA Hybrid GPU cooler 
OSMonitorKeyboardPower
Windows 10 Asus MG279Q - 24" 144Hz 1080p Filco Majestic II w/ Cherry Reds Seasonic X 760W 
CaseMouseMouse PadAudio
Bitfelix Prodigy Logitech G400 Razer Goliath AKG A701 
AudioAudio
JDS Labs Objective 2 JDS Labs ODAC 
CPUMotherboardGraphicsRAM
Core i5 750 3.99 (190x21) 1.376v Load ASUS P7P55d-E Pro GTX 670 FTW <- Poor overclocker :( 8GB (4x2GB) G.Skill DDR3 1600 
Hard DriveHard DriveOptical DriveOS
Samsung 830 Evo 128GB 2x 2TB  Some DVD drive OSX 10.10.4 
MonitorPowerCaseMouse
Asus 1080P Crap TX 750 HAF 922 G400s 
Mouse PadOther
Apple Keyboard Xbox One controler 
CPURAMHard DriveHard Drive
C2D 2,26GHz under volted @ .978v 8GB  Crucial M4 64GB SSD 500GB Scorpio Black 
OSMonitorKeyboardMouse
OS X 10.0 1280x800 Built-in Trackpad 
Audio
Built-in 
  hide details  
Reply
 
Gsvlip Dudyrm
(15 items)
 
Oda'maksv
(9 items)
 
CPUMotherboardGraphicsRAM
3770k @ 4.5 1.312 load Zotac Z77 ITX Wifi GTX 1070 Gaming 2126/2249 w/ Hybrid cooler TridentX 16GB 2400MHz 
Hard DriveHard DriveCoolingCooling
Samsung 850 Pro 1TB Seagate 2TB H105 EVGA Hybrid GPU cooler 
OSMonitorKeyboardPower
Windows 10 Asus MG279Q - 24" 144Hz 1080p Filco Majestic II w/ Cherry Reds Seasonic X 760W 
CaseMouseMouse PadAudio
Bitfelix Prodigy Logitech G400 Razer Goliath AKG A701 
AudioAudio
JDS Labs Objective 2 JDS Labs ODAC 
CPUMotherboardGraphicsRAM
Core i5 750 3.99 (190x21) 1.376v Load ASUS P7P55d-E Pro GTX 670 FTW <- Poor overclocker :( 8GB (4x2GB) G.Skill DDR3 1600 
Hard DriveHard DriveOptical DriveOS
Samsung 830 Evo 128GB 2x 2TB  Some DVD drive OSX 10.10.4 
MonitorPowerCaseMouse
Asus 1080P Crap TX 750 HAF 922 G400s 
Mouse PadOther
Apple Keyboard Xbox One controler 
CPURAMHard DriveHard Drive
C2D 2,26GHz under volted @ .978v 8GB  Crucial M4 64GB SSD 500GB Scorpio Black 
OSMonitorKeyboardMouse
OS X 10.0 1280x800 Built-in Trackpad 
Audio
Built-in 
  hide details  
Reply
post #19 of 31
Question on why you need swap for Hibernate: Is this just so the session is saved to the HDD? I never used a swap space when I had 4GBs of RAM and Sleep worked fine. However, I never saw a hibernate option in the various power menus either.

I just don't know though what you could possibly be running that would consume 8GBs of RAM though.
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
Reply
post #20 of 31
I have been experimenting with *nix as a DAW/recording studio - with limited success.

I would, personally, recommend keeping a swap-part.
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 Asus Lappy GeForce GT520M 4096 
Hard DriveOptical DriveOSMonitor
500GB LG W7=64 ult + Slackware13.1_64 + MineOS HP w2207h 
KeyboardCaseMouse
logitech G11 Fugly, lol logitech mx518 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 Asus Lappy GeForce GT520M 4096 
Hard DriveOptical DriveOSMonitor
500GB LG W7=64 ult + Slackware13.1_64 + MineOS HP w2207h 
KeyboardCaseMouse
logitech G11 Fugly, lol logitech mx518 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Linux swap necessary?