[SOLVED & FASCINATING] SWAP - does it really?

Post Reply
Message
Author
boombaby
Posts: 59
Joined: Fri Jul 27, 2018 1:41 am

[SOLVED & FASCINATING] SWAP - does it really?

#1 Post by boombaby »


Hello, Any...

Something I have wanted to know for a long, long time but never got around to asking.

Why does my SWAP file always show 0 (zero) usage? To my recollection it has never changed. Is it because modern memory is huge and "swapping" becomes unnecessary - or what?

Simple answer good. Any further depth of explanation would be good too - because it has been a real puzzle to me.

Regards,
boombaby
_
Last edited by boombaby on Thu Sep 06, 2018 9:22 am, edited 1 time in total.

User avatar
chrispop99
Global Moderator
Posts: 3171
Joined: Tue Jan 27, 2009 3:07 pm

Re: SWAP - does it really?

#2 Post by chrispop99 »

It obviously does depend on the amount of RAM you have, and also how you use your machine. If you have multiple browser tabs open, then do something intensive like rendering video, you might run into swap. I have 8GB on my everyday machine, and swap has never been used.

If you use Hibernate, you need an appropriately sized swap, but otherwise, given sufficient RAM for your use case, it is possible to run without it.

Chris
MX Facebook Group Administrator.
Home-built desktop - Core i5 9400, 970 EVO Plus, 8GB
DELL XPS 15
Lots of test machines

User avatar
Eadwine Rose
Administrator
Posts: 11895
Joined: Wed Jul 12, 2006 2:10 am

Re: SWAP - does it really?

#3 Post by Eadwine Rose »

My swap got used when one of the two ram banks (also 8G total) didn't sit properly after opening the case. Didn't notice a thing at first.. but saw the bar go up.. HUH?? and then saw it didn't see the second one, so.. back to reopen that case and reseat both of them. Prob solved. :)
MX-23.2_x64 July 31 2023 * 6.1.0-18-amd64 ext4 Xfce 4.18.1 * 8core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 525.147.05 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 860EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
Gerson
Posts: 876
Joined: Sun Nov 12, 2017 10:58 am

Re: SWAP - does it really?

#4 Post by Gerson »

@boombaby wrote:
Why does my SWAP file always show 0 (zero) usage? To my recollection it has never changed. Is it because modern memory is huge and "swapping" becomes unnecessary - or what?
Maybe this will clarify your situation, it's in Spanish but it's easy to understand or you can use the Google translator.
http://forum.mxlinux.org/viewtopic.php? ... 87#p459661
No todos ignoramos las mismas cosas. :confused:

User avatar
oops
Posts: 1603
Joined: Tue Apr 10, 2018 5:07 pm

Re: SWAP - does it really?

#5 Post by oops »

SWAP - does it really?
If you can see the swap item (see below) then your swap is really and ready to be used if needed.

Code: Select all

cat /proc/swaps 
Filename				Type		Size	Used	Priority
/dev/sdax                               partition	9215996	0	-2

#or
 free
              total        used        free      shared  buff/cache   available
Mem:        6033128     1491116     3391056        7932     1150956     4369596
Swap:       9215996           0     9215996
Pour les nouveaux utilisateurs: Alt+F1 pour le manuel, ou FAQS, MX MANUEL, et Conseils Debian - Info. système “quick-system-info-mx” (QSI) ... Ici: System: MX-19_x64 & antiX19_x32

boombaby
Posts: 59
Joined: Fri Jul 27, 2018 1:41 am

Re: SWAP - does it really?

#6 Post by boombaby »

Thanks to each. Fascinating!

User avatar
Stevo
Developer
Posts: 12774
Joined: Fri Dec 15, 2006 8:07 pm

Re: [SOLVED & FASCINATING] SWAP - does it really?

#7 Post by Stevo »

I can easily get my 16 GB machine to run out of RAM and start using swap by trying to compile a 64-bit and 32-bit version of Thunderbird or Pale Moon at the same time and letting them use all 12 available threads...so I do them one at a time.

User avatar
oops
Posts: 1603
Joined: Tue Apr 10, 2018 5:07 pm

Re: [SOLVED & FASCINATING] SWAP - does it really?

#8 Post by oops »

Stevo wrote: Thu Sep 06, 2018 2:26 pm I can easily get my 16 GB machine to run out of RAM and start using swap by trying to compile a 64-bit and 32-bit version of Thunderbird or Pale Moon at the same time ...
... With your swappiness by default (60) or or already optimized ?
cat /proc/sys/vm/swappiness #60 by default
10 #optimized for desktop standard value
cat /proc/sys/vm/vfs_cache_pressure #100 par defaut
50 #optimized for desktop
Pour les nouveaux utilisateurs: Alt+F1 pour le manuel, ou FAQS, MX MANUEL, et Conseils Debian - Info. système “quick-system-info-mx” (QSI) ... Ici: System: MX-19_x64 & antiX19_x32

Post Reply

Return to “General”