Swap space is an area of the hard disk that serves as an overflow when the computer memory is full. The memory used by inactive applications is partially written out to disk to make room for other applications and for the disk cache for active files.

learn more… | top users | synonyms (1)

57
votes
3answers
31k views

Why is swappiness set to 60 by default?

I just read some stuff about swappiness on Linux. I don't understand why the default is set to 60. According to me this parameter should be set to 10 in order to reduce swap. Swap is on my hard ...
0
votes
0answers
14 views

set swap space to 0 on RHEL for testing

I have tried to change the swappiness to 100, and used the malloc() code in order to set the swap to 0 on my rhel system But this not seem to be helpful . The system memory allocation looks like this ...
1
vote
2answers
31 views

Get swap memory info where swapinfo not available

I have HP-UX box. I need to write shell script to see the swap memory. Unfortunately. The box don't have swapinfo command. Is there any alternative way to see the swap usage percentage? Please note ...
1
vote
4answers
6k views

kswapd0 takes 99% to 100% CPU in RHEL 6.3

I have 5 systems on which I have just installed RHEL6. System configuration is CPU-i7 HDD-500 GB RAM-2 GB Swap- 4 GB I have installed the same software's and all the configuration as per ...
1
vote
1answer
33 views

Ext4 corrupted and unrecoverable after LVM resizing + power failure

I have a completely standard, single hard drive Fedora 23 desktop. The dual-boot installer set up the Linux partition as LVM, with root, swap and home logical volumes; root and home were both ext4. ...
0
votes
1answer
31 views

Vim saved file not updating on webpage

I am attempting to update an HTML file on my server, but when I do so it doesn't appear to be updating, but rather, serves an old copy instead. I went through the usual process of pressing :w and ...
1
vote
1answer
564 views

Swap appears to not be in use

(I am currently using Ubuntu 14.04 LTS, GNOME environment) tl;dr How can I force more memory swapping (swappiness already at 100)? I have recently been experiencing a lot of system freezes/crashes. ...
3
votes
1answer
44 views

Keep a process in RAM (prevent it from swapping)

I want to keep a process in RAM. It should never go into swap. Is this possible? The process is a Java program. I'm running CentoS 7.
1
vote
0answers
28 views

how does systemd activate encrypted swap file on alternate partition?

I have 2 partitions: / and /data. My swap file is encrypted at /data/swap. So /etc/crypttab looks like: root_crypt UUID=6666 none luks swap /data/swap /dev/urandom swap And /etc/fstab looks like ...
-1
votes
0answers
32 views

I busted my ssl.conf file and when I do a recovery I can't overwrite the file with new settings

So, I thought I would be super smart and figure out how to disable the older SSL v2 and v3 on the web server. Turns out I messed something up. So, I tried to open the file and then make the changes, ...
3
votes
1answer
22 views

How does Linux manage “simultaneous” writes to swap/disk partitions in virtual memory?

I'm currently working on an educational operating system called Pintos. While implementing virtual memory, one of the issues that I'm having is writing data to swap in a page fault that happened while ...
4
votes
1answer
70 views

Silent disk errors and reliability of Linux swap

My understanding is that hard drives and SSDs implement some basic error correction inside the drive, and most RAID configurations e.g. mdadm will depend on this to decide when a drive has failed to ...
3
votes
1answer
40 views

Making a swap partition using lvm

When we make a swap using a regular physical drive, we just use fdisk and make a partition with type swap, using the swap code for that partition, followed by mkswap and swapon commands. But what ...
0
votes
2answers
38 views

Cleaning swap space while running

I have a theoretical question, What would happen if I clean up all the swap space while running, Would the operating system crash because of page faults that would happen in the kernel?
26
votes
1answer
4k views

How to set per process swapiness for linux?

/proc/sys/vm/swappiness is nice, but I want a knob that is per process like /proc/$PID/oom_adj. So that I can make certain processes less likely than others to have any of their pages swapped out. ...
1
vote
1answer
32 views

Machine freezes once it hits swap space under heavy load

I encountered several crashes of my machine. Meanwhile, I can reproduce it when I start a program that fills up all memory. Once the system starts writing to the swap file, the system freezes and I ...
3
votes
2answers
2k views

Log from oom killer

I'm running a virtual machine at a provider where you pay for everything you use (CPU, memory, disk IO, bandwidth, etc). Currently my machine has 512MB ram and 1GB swap area. The kernel version is ...
7
votes
1answer
1k views

How do I increase the maximum swap space on Mac OS X? [on hold]

On Mac OS X Yosemite 10.10.5, when I try to run a calculation that needs to allocate and use 128 GB of memory (it is a command line program written in C), the kernel kills my process with extreme ...
-1
votes
0answers
15 views

SWAP memory of my solaris server is used more than its threshold

SWAP memory of my solaris server is used more than its threshold, is it possible to free some space by restarting the processes which are using most of SWAP memory?
0
votes
0answers
21 views

swap goes the second drive, how can I return it to normal from command line?

The following is my plan for partition of CentOS 6.7. I have two disks with A for system and files, B totally for backup. But, after installation, I log in using ssh root. Here is what I see: ...
3
votes
1answer
20 views

Setting up encrypted swap in LMDE (debian)

I want to use a swap drive that is encrypted by a random key on boot. I'm not sure if I am doing it safely, though. I currently have /etc/crypttab based off of the example on arch wiki. Unlike their ...
0
votes
1answer
29 views

-/+ buffers/cache & Swap

When should the usage of swap get started? or How do I know that my swap is being used? At least some times if not always, considering the default swappiness of 60 Also, why does free offer to omit ...
55
votes
5answers
7k views

What NOT to put on an SSD?

I bought an SSD and I am going to set up my desktop system with a completely fresh Linux installation. SSDs are known to be fast, but they have a disadvantage: The number of writes (per block?) is ...
1
vote
1answer
26 views

vm.swappines parameter influence on system without swap partition

I run across following definition of vm.swappines: The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. So, if I have ...
0
votes
1answer
24 views

Crash with input/out error and swap unmounting [duplicate]

I am looking for hints on this problem. I've searched around, but can't find something exactly similar. I am running Debian 8 stable, updated, very minimal install (i3wm, small number of apps ...
1
vote
3answers
61 views

How to configure swappiness in Linux Memory Management?

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk,what is the default setting and how to configure that to improve overall ...
3
votes
4answers
562 views

8G RAM and SSD - how big should the swap be?

I have a computer with 8G RAM and a 128G SSD. I don't plan hibernating. What swap size would you recommend? Would you change any swappiness? In the nearest future I'll compile programs (or even ...
-2
votes
3answers
62 views

why we need ram if we having swap memory? [closed]

In Linux we have a swap memory right. the system will use swap memory if ram memory is full.then what is require of RAM we can use directly swap memory.
3
votes
1answer
48 views

Wear leveling of SD card because of swap file in embedded linux

I need to enable a swap file on my embedded linux product. The problem is that the file is located on an SD card. At the moment I'm using 15MB swap and about 120MB RAM because of temporary increases ...
1
vote
2answers
53 views

Recover from faking /proc/meminfo

So, without really thinking too much, I ran this script: #!/bin/bash SWAP="${1:-512}" NEW="$[SWAP*1024]"; TEMP="${NEW//?/ }"; OLD="${TEMP:1}0" sed "/^Swap\(Total\|Free\):/s,$OLD,$NEW," /proc/meminfo ...
1
vote
1answer
63 views

hibernation and swap partitions on ssd/hdd

I'm quite a beginner in Linux and I've got some problem to decide: I've got a laptop with two disks - 1TB HDD and 256 SSD, and 12GB RAM and I want to install debian on SSD. I used hibernation a ...
1
vote
0answers
25 views

Real-time monitoring of changes in swap use (per process)

I'm looking for a way to observe which processes in my system are consuming an increasing amount of swap over time. The following function generates a list of swap user per process : sbp(){ grep ...
4
votes
1answer
115 views

Pulling all of a process's swapped memory out of swap

How would one go about quickly pulling all of a process's swapped memory out of swap without writing to disk? The context on this issue is trivial, as the systemic issue necessitating the question ...
2
votes
2answers
103 views

Free up swap space all at once after swap event

I use my Linux box for a lot of computational work, and sometimes a particular computation eats a lot of RAM. When I'm done, I end up with a bunch of swap used and a bunch of free memory, and if I go ...
3
votes
0answers
32 views

Why does /proc/*/status not account for all swap used on a system?

I have a system that has been swapping recently and am unable to account for all swap that is shown as in use by tools like 'free' or 'top'. Specifically, I can account for 19GB of 28GB swap used ...
4
votes
1answer
107 views

Encrypted filesystems with swap partitions

A common error that happens with Ubuntu, though not Ubuntu in particular is the options of being able to encrypt the file system at installation time which creates an encrypted swap partition with ...
1
vote
2answers
60 views

Swap output in last x minutes

Is there any command or script to give o/p as " swap used in last 10 minutes is x" ? I wished to use that out put for my nagios monitoring.. I have used SAR in my below script and is trying to run on ...
4
votes
1answer
43 views

Can I mark _current_ memory contents as non swappable?

Background: in my linux (ubuntu) workstation, I want to run some experiments that allocate more memory than the physical RAM while I do other 'normal' stuff in the GUI. Problem: I have plenty of ...
3
votes
3answers
161 views

I need to take the output of command and make it the name of a file using a script [duplicate]

I am working on a way to integrate our Linux machines into our SCCM Reports. One of the things we would like to do is verify the swap size on the machines. I know that I can get the swap amount on ...
3
votes
2answers
91 views

Swap: Better to create a dedicated swap partition or to create a swap file?

is there a rationale when to create a dedicated swap partition vs. creating a swap file, for example like /tmp/swap? In my certain case, memory is kind of low (1GB), disk space on a SSD is pretty ...
1
vote
1answer
68 views

how to make swap permanent in vm?

I create the ubuntu vm by vagrant. I want to add the swap to vm. the steps: mkdir /swapfile cd /swapfile sudo dd if=/dev/zero of=swap bs=1024 count=2000000 sudo mkswap -f swap sudo swapon swap add ...
1
vote
0answers
83 views

Creating a sparse (automatically expanding and contracting) swap file with hole-punching support

I have this crazy idea, and want to know the pitfalls of such an approach (or whether it can even work with no deadlocks.. etc). The goal is to create an automatically expanding and contracting ...
1
vote
1answer
3k views

Extending swap on Centos

I recently created a swap file on my centos 6 based VPS using this guide. Now I wanted to extend this swap and I was reading through this guide. However, I think I've created a swap file than a ...
2
votes
0answers
54 views

Can't delete a swap partition, says that it's mounted while swapon says it's not?

I have a swap partition mounted on /dev/sda6 Linux Mint 17.2/Windows 10 dual boot. Am using HP 2000 notebook PC with 4GB RAM. When I installed Linux Mint I created a swap partition which as it happens ...
0
votes
0answers
57 views

When hibernating : “PM: Swap header not found”

I've already seen Debian hibernate problem PM: Swap header not found, but the difference is that it's not a file swap but actually a swap partition. I'm on Ubuntu 15.10. My swap partition: $ ...
9
votes
2answers
4k views

What is the appropriate value of vm.swappiness when using zram?

I'm using zram on my computer as a compressed RAM-backed swap. When the system needs to swap something out, swapping it to a zram-backed swap file is more or less equivalent to compressing that data ...
9
votes
3answers
161 views

Is it possible to impose some kind of soft limit on the memory consumption of processes?

I reckon it's not such an uncommon problem: one process allocates massive amounts of memory (be it due to a memory-leak bug, because you try to process an infeasibly large input file, or whatever). ...
1
vote
0answers
32 views

Restoring in-memory/swapped page state on resume from hibernation

I'm a big fan of Linux's hibernation support, which works extremely well on all the (admittedly slightly older) hardware I've tried it on. I highly prefer it to full shutdown and power up. There's ...
3
votes
2answers
80 views

What is happening with the Linux swap partition data when running Windows via dual-boot

Hmm, I would like to know what is happening with the data on the Linux swap partition when the Linux system is turned off and by the next start the Windows operating system via GRUB2 will start. 3 ...
7
votes
4answers
20k views

Swap usage too high?

I have a Debian Sid box, freshly installed about a month ago, with no desktop apps running at the moment. Any command I try to run (via ssh) makes the hard disk work very hard. The system worked ...