Swapping: Unterschied zwischen den Versionen
Aus Wiki-WebPerfect
Admin (Diskussion | Beiträge) |
Admin (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
''Memory swapping is a computer technology that enables an operating system to provide more memory to a running application or process than is available in physical random access memory (RAM). When the physical system memory is exhausted, the operating system can opt to make use of memory swapping techniques to get additional memory. Mostly, swapping means the os outsource some memory to the swap space on a disk (In Linux this is a disk partition and in Windows there is a swap file called "pagefile.sys")'' | ''Memory swapping is a computer technology that enables an operating system to provide more memory to a running application or process than is available in physical random access memory (RAM). When the physical system memory is exhausted, the operating system can opt to make use of memory swapping techniques to get additional memory. Mostly, swapping means the os outsource some memory to the swap space on a disk (In Linux this is a disk partition and in Windows there is a swap file called "pagefile.sys")'' | ||
− | |||
=== Display processes using swap space (Linux) === | === Display processes using swap space (Linux) === | ||
Zeile 6: | Zeile 5: | ||
find /proc -maxdepth 2 -path "/proc/[0-9]*/status" -readable -exec awk -v FS=":" '{process[$1]=$2;sub(/^[ \t]+/,"",process[$1]);} END {if(process["VmSwap"] && process["VmSwap"] != "0 kB") printf "%10s %-30s %20s\n",process["Pid"],process["Name"],process["VmSwap"]}' '{}' \; | awk '{print $(NF-1),$0}' | sort -h | cut -d " " -f2- | find /proc -maxdepth 2 -path "/proc/[0-9]*/status" -readable -exec awk -v FS=":" '{process[$1]=$2;sub(/^[ \t]+/,"",process[$1]);} END {if(process["VmSwap"] && process["VmSwap"] != "0 kB") printf "%10s %-30s %20s\n",process["Pid"],process["Name"],process["VmSwap"]}' '{}' \; | awk '{print $(NF-1),$0}' | sort -h | cut -d " " -f2- | ||
</source> | </source> | ||
+ | |||
+ | |||
+ | == Swappiness configuration == | ||
+ | '''Get current used swap space:''' | ||
+ | free -h | ||
+ | |||
+ | '''Get current swappiness configuration''' | ||
+ | sysctl vm.swappiness | ||
+ | |||
+ | '''Change swappiness for the current session (swappiness config are removed after reboot):''' | ||
+ | sudo sysctl vm.swappiness=0 | ||
+ | |||
Version vom 21. August 2020, 09:07 Uhr
Memory swapping is a computer technology that enables an operating system to provide more memory to a running application or process than is available in physical random access memory (RAM). When the physical system memory is exhausted, the operating system can opt to make use of memory swapping techniques to get additional memory. Mostly, swapping means the os outsource some memory to the swap space on a disk (In Linux this is a disk partition and in Windows there is a swap file called "pagefile.sys")
Display processes using swap space (Linux)
find /proc -maxdepth 2 -path "/proc/[0-9]*/status" -readable -exec awk -v FS=":" '{process[$1]=$2;sub(/^[ \t]+/,"",process[$1]);} END {if(process["VmSwap"] && process["VmSwap"] != "0 kB") printf "%10s %-30s %20s\n",process["Pid"],process["Name"],process["VmSwap"]}' '{}' \; | awk '{print $(NF-1),$0}' | sort -h | cut -d " " -f2-
Swappiness configuration
Get current used swap space:
free -h
Get current swappiness configuration
sysctl vm.swappiness
Change swappiness for the current session (swappiness config are removed after reboot):
sudo sysctl vm.swappiness=0