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)

-1
votes
3answers
47 views

why we need ram if we having swap memory?

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
25 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
37 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
22 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
18 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
0answers
31 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
78 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 ...
4
votes
1answer
31 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
159 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
63 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
32 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
40 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
0answers
36 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: $ ...
2
votes
0answers
46 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 ...
9
votes
3answers
143 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
22 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
62 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 ...
4
votes
2answers
56 views

Why can I only have a limited number of swap files

This is a theoretical question. Why can I only have 29 Swap files/partitions? If I wanted to generate 10k 1MB swap file and swap them on, it fails at the 30 swap file with swapon: /tmp/swap29: ...
3
votes
1answer
103 views

How can I create a swap file?

How can I create a swap file on a Linux system? I know how to create and use a swap partition but can I also use a file instead?
1
vote
1answer
24 views

What happens if my RAID fails while the swap is on it?

Today I removed swap from the system drive on my Debian. And created a swapfile on md0. So, I have a RAID1 array for data and a swapfile (the only swapfile). The system with boot partition is on ...
0
votes
0answers
68 views

Change percentage of time swap space is used

A question was proposed to me in an interesting format. I was asked "How would I set swap space to be used 50% of the time?" I know how to set the swapiness value in a range from 0-100 in ...
3
votes
1answer
129 views

How safe is it to increase tmpfs to more than physical memory?

My server has 2GB RAM and 120GB SSD, plus some RAID arrays for storage. OS is Debian 8 (Linux 3.16). I have a MySQL intense application that has tmpdir = /run/mysqld, which is a tmpfs configured by ...
3
votes
1answer
41 views

Is it necessary to encrypt a swap * file * if it will reside on an encrypted root filesytem?

I'm running Linux on my Laptop and wish to protect my data in case the machine is lost or stolen. I've configured an encrypted ArchLinux environment and have everything working the way that I want. ...
2
votes
1answer
20 views

Linux as 3rd boot OS

I would like to install another linux kali beside my linux mint and win10. My question is, do I need make 3 partition again for installation, /root /home and swap od I don't need swap because I ...
4
votes
2answers
239 views

Resize XFS home directory in LVM

I am desperately trying to increase the swap space available to my server from 4GB to 16GB, however at present XFS + something is making this impossible. I have a single SSD hosting the OS (CentOS ...
1
vote
1answer
59 views

Page cache elimination in Linux kernel

Optimizing the page cache space for less memory utilization in some system where systems don't have swap space and external flash drive or hard disk. Is there any possibility that if we can remove or ...
7
votes
1answer
557 views

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

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 ...
3
votes
1answer
51 views

Expand the size of swap partition

I did some partition size expansions of my centOs system and recover boot loader and file system successfully.I also changed the location and expanded the swap (5GB to 8GB) partition along with above ...
1
vote
2answers
49 views

Fixing fstab after reformatting swap

I just made a small mistake and reformatted my swap partition. It's still formatted as a swap partition - I was fortunate not to touch anything more important. However, I notice that the uuid has ...
1
vote
2answers
108 views

On page fault, how does Unix determine if the faulting address is in swap space?

When a page fault occurs for a virtual address for any process how does the linux/unix operating system determine whether that page (of that virtual address) was swapped previously present in memory ...
0
votes
1answer
39 views

Cached Memory but swap is being used [duplicate]

I've got a VM with 16gb of memory and recently it's been using some of the swap space. At first I thought this was because it was using all the memory but then I read some articles about the Cached ...
2
votes
1answer
73 views

How does mkswap work? What is in the swap header it creates?

I am looking at mkswap and trying to understand how exactly it works. From what I understand, it sets up Swap space on a partition by creating a swap header. How large is this swap header? Is it one ...
1
vote
2answers
154 views

Is it safe to delete all swap partitions?

More explicitly: If it safe to shutdown a system, boot from a live cd, delete all disk swap partitions, and boot the system? This is in follow up to How to safely turn off swap permanently? (on ...
1
vote
1answer
150 views

How low can I go on RAM?

I have some old PCs runnning on my business. And by old I mean PENTIUM-3 800 MHZ and AMD DURON 950 MHZ, with 256MB RAM. They are running my business software today on Windows XP. I want to run Linux ...
4
votes
1answer
158 views

Permanent swapping with lots of free memory

We have a Linux server running Debian 4.0.5 (Kernel 4.0.0-2) with 32G RAM installed and 16G Swap configured. The system uses lxc containers for compartmentalisation, but that shouldn't matter here. ...
21
votes
6answers
4k views

How to safely turn off swap permanently? (on Debian Jessie)

I fresh installed Debian Jessie with default partitioning on an SSD drive. My current disk partitions look like this: As I have 16GB RAM, I think I don't need swap. On Windows, I had it turned off ...
5
votes
2answers
522 views

Is clearing a full swap necessary / wise?

We have a linux machine, in which the swap partition gets filled to the limit from time to time. There's still enough of RAM free, so there should be no risk of running out of memory. The usual course ...
3
votes
1answer
42 views

How to prevent swapping on Mac OS X?

I am inclined to run Tails through a virtual machine so that I could chain two VPNs. One running through the host Mac osx and one more running from inside the virtual machine that's running Tails. ...
2
votes
1answer
60 views

Zeroing out FreeBSD swap space?

I'd like to zero-fill the partitions/slices in my FreeBSD VMs in order to provide for better compression for archival. For those partitions/slices with file systems the process is no problem for me to ...
3
votes
3answers
274 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 ...
1
vote
1answer
26 views

Old Xen Installation Unable to be Formatted

I recently tried to format a disk that had an old Ubuntu 14.04 partition and a Xen Swap Disk partition. I am currently running the Ubuntu Live CD and trying to access my partitions on the drive for ...
3
votes
3answers
248 views

Linux, SSD and swap

This article suggests not to create a swap space on an SSD drive in order to reduce its wear. On the other hand, it suggested here that swap space positively affects performance. Would it be a better ...
1
vote
2answers
154 views

Is there way to force Linux to unswap when there is low CPU usage?

After working more than 1 day on my machine swap becomes about 1GB. Some of my panel plugins go to swap so they become laggy. Moreover system doesn't unswap until I make it to do it swapoff ...
0
votes
1answer
62 views

How to create Swap from already created mount points

I have prepared a CentOS 6.5 with all mount points at formatting time, including swap. Now, when I am trying to run command swapon, it shows 0 0 0. And when I am trying to create it again using ...
3
votes
0answers
62 views

FreeBSD shared swap partition with Linux

What must I do, to run these commands before Arch Linux calls swapon -a? mkswap /dev/sdaX swapon /dev/sdaX Just in case it matters, /dev/sdaX was created in FreeBSD 10.1 environment, as soon as ...
0
votes
1answer
67 views

Linux Swap Space

I have 32GB memory. SSD and NonSSD drives. I installed Linux to NonSSD drive but I prefer SSD for /var directory and I didn't create swap space because there is high memory. I know physical memory ...
3
votes
2answers
130 views

Swap on tmpfs (Obviously a bad idea, but is it possible?)

This question originated with a joke between co-workers about increasing performance by moving swap partitions to a tmpfs. Clearly even if this is possible, it's not a good idea. All I want to know ...
0
votes
1answer
95 views

How to calculate Swap warning/critical dynamically through script?

I have used SAR in my below script and is trying to run on individual servers for my nagios monitoring. Can someone please suggest how i can get the swap warning and swap critical values in my check ...
4
votes
1answer
88 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 ...
2
votes
1answer
91 views

Swap suddenly vanished from Debian?

Everything has been going fine for 6 months now until my swap suddenly vanished today. Now that I look into it, I find that my disk partitioning is a bit weird. What happened to it, and what should I ...