Questions tagged [swap-file]

Swapfile is commonly refers to a file backed storage for paging. (aka swapping)

Modern operating systems can use disks (or other IO) to temporarily store in memory information. This allows them to write this information and reuse the main memory which contained it, with the ability to recover this information.

Any modern OS can do this with chunks of memory and it is called paging.

However historically only whole processes could be swapped out. Hence the traditional use of 'swap partition' or 'swap file'. In the case of a 'swap-file' the data is stored on a file, incurring extra filesystem overhead.

50 questions
147
votes
14 answers

What's the easiest way to delete Vim swapfiles I've already recovered from?

Sometimes Vim crashes and leaves me a swapfile. That's awesome. Then I open the file I was editing and Vim asks me if I want to recover. I do, thanks. When it's done, Vim tells me, You may want to delete the .swp file now. Why, yes, I do. How…
Peeja
  • 3,009
26
votes
8 answers

Why half of my RAM of 8GB is missing?

Have been sitting with 8GBs of RAM for 2 years still thinking I needed another 4GBs and never questioning why so often I get message about low physical memory that would close all open programs (Firefox mostly since it is mainly what I use) if not…
Boris_yo
  • 5,994
12
votes
3 answers

Does it matter about the amount of the swap area in Linux system

Does it matter if the amount of a swap area in Linux was set too small (say 1Gb), and the main RAM is 128Gb? Should we always set the amount of swap area to be twice the amount of RAM? UPDATED: Hi, thank all of you for replying this question. In…
mining
  • 233
5
votes
0 answers

swapon failed: Invalid argument with ext4 swapfile and swap partition

I've tried enabling swap both on a swapfile (on ext4): # file /mnt/usb/swapfile /mnt/usb/swapfile: Linux/i386 swap file (new style), version 1 (4K pages), size 1023999 pages, no label, UUID=9dfaa27a-d72f-4dad-ac97-ffead7e29845 # swapon…
Flobe
  • 51
  • 1
  • 2
4
votes
4 answers

Why using swap file over a SMB/NFS mounted filesystem is not possible in Linux?

I'd like to use another machine's unused RAM as swapspace for my primary Linux installation. I was just curious about performance of network ramdisks compared to local (slow) mechanical hard disks. The swapfile is on a tmpfs mountpoint and is shared…
Avio
  • 957
4
votes
1 answer

How to delete swap file in ubuntu?

I am trying to delete the swap file by the following link: https://www.digitalocean.com/community/questions/delete-swap-file However, when I type: sudo rm /swapfile I am getting the following error: rm: cannot remove `swapfile': Operation not…
khalidh
  • 185
3
votes
4 answers

How to disable Swapfile.sys on Windows 10? [confirmed bug]

I want to delete the swapfile.sys from my C: partition because it prevents me from shrinking the drive. I set the Paging File option to 'No paging file' in the 'Virtual memory' window for my C partition and restarted but the swapfile.sys is still…
GoUkraineGo
  • 2,171
3
votes
0 answers

How to limit (not Disable) Swapfile.sys size?

How can I limit the size of c:\swapfile.sys? I would expect wmic swapfileset to work, but it doesn't exist: wmic swapfileset where name="c:\\swapfile.sys" set initialsize=1000,maximumsize=1000 swapfileset - Alias not found. If I can't limit it I'll…
John Peterson
  • 187
  • 3
  • 12
3
votes
1 answer

swap file vs partition

I needed some more swap for something I'm doing so I set up a swap file rather than editing partitions. Are there any disadvantages to using a swap file instead of a swap partition? My OS is Debian Linux.
Carbon
  • 165
3
votes
2 answers

how much swap space is too much on x64 and will cause problems?

Apart from using up too much disk space, how much swap space can you allocate before it will degrade performance or cause problems on an x64 OS? What differences are there between the x64 OSes? I'm not talking used swap space, just telling the OS…
BeowulfNode42
  • 2,022
  • 2
  • 20
  • 25
3
votes
1 answer

Why does swapon take ages when enabeling a swap file?

I've created a swap file with dd if=/dev/zero of=swap.img bs=1024k count=4k mkswap swap.img swapon swap.img While this works, the swapon command takes ages (approx 10min) to finish. Enabling the swap file in /etc/fstab means the boot process will…
Chaos_99
  • 1,008
3
votes
1 answer

How to deal with huge pagefile (committed memory) usage created by ASUS LightingService?

I have an Asus TUF Gaming laptop that I have owned for around a year. I am running Windows 11 on it. Recently, I noticed a significant increase in memory usage, specifically from higher page file utilization. After some investigation, I identified…
3
votes
1 answer

Cannot find swap device

I'm using Pop OS 22.04. GRUB isn't used. Here is the procedure I've followed in order to activate the swap fich=/swap/swapfile truncate -s 0 $fich chattr +C $fich btrfs property $fich compression none fallocate -l 40G $fich chmod 600 $fich mkswap…
2
votes
1 answer

Swap file automatic loading in Linux

How can I get the Swap file to load at boot up time rather than having to load it manually with GParted after each boot up? I have Linux Mint 17.2 Xcfe and Mate and both use the same swap file. Here is the fdisk -l read out: Disk /dev/sda: 160.0 GB,…
user519395
  • 21
  • 1
2
votes
1 answer

Swap series of filenames conditionally

If have the following problem: I have a series of files that come in pairs (but not always). There is 2400??????_001.jpg and 2400??????_002.jpg. I need to swap the _001 and _002. So I thought I could do this: for f in $(find -type f -name…
dexter
  • 141
1
2 3 4