User avatar
davidcoton
Posts: 4143
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 1:40 pm

ProDigit wrote: There is no proof that the system does not access swap, when not needed. It looks quite the opposite, as I'd this was the case, swap size would be zero.
You really have not understood how swap works. The swap file (or partition on some systems) reserves a chunk of memory storage on the SDCard or SSD/HDD that can be used by the OS. That requires some startup time, but no run time. It is only actually used when the system runs short of RAM, which may be never. Until RAM runs out, the run time penalty is zero. If RAM runs out, then swap may save a system crash -- at the cost of slower running compared to having more RAM.

There are two benefits of disabling and deleting swap:
  1. A small saving in startup time
  2. A saving of space on the SDCard or SSD/HDD
If neither of these are relevant then there is no downside to leaving the swap file enabled.

As for proof that the system does not access swap before it is needed (but, in any case, why would it?), look at this post from above:
thagrol wrote: Run

Code: Select all

free -m
to see how much swap is actually being used. For comparison, here's the output from my 4B 1GB NAS/DNS/DHCP/PXE/VPN gateway server:

Code: Select all

              total        used        free      shared  buff/cache   available
Mem:            974         104         590           7         279         800
Swap:          2546           0        2546
It has a 2.4GB swap partition but as you can see it is not being used so has no impact on performance.
EDIT: to satisfy a [pedant] comment :lol:
Last edited by davidcoton on Sat Aug 17, 2019 4:00 pm, edited 1 time in total.
Signature retired

User avatar
PeterO
Posts: 5019
Joined: Sun Jul 22, 2012 4:14 pm

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 1:41 pm

ProDigit wrote:
Sat Aug 17, 2019 1:21 pm
The swap file is definitely being used, as even a bare system uses 80MB of swap file.
Nonesence ! I have a system here running several quite large applications (Chromium with several tabs, emacs with several windows, glade, DevHelp) and no swap used yet.... Not sure what you've done to your system to make it use 80M when nothing is happening.
There is no proof that the system does not access swap, when not needed. It looks quite the opposite, as I'd this was the case, swap size would be zero.
If it's used 80MB it's because it needed to use it, it doesn't just use it for the fun of it. But without details of what you are running on your system to say "It's used 80MB even though it didn't need to" is meaningless.
Removing a swap file, will reduce the drag and delays (latencies) associated with having a swap file.
It's not as much speeding up the system, as it is reducing the delay caused by having a swap file.
Again where is the proof that these latencies are real if the swap space exists but isn't being used.
I really can't explain any better, but if you're not Willing to do the research, and just GOOGLE the topic, I really can't do much about that.
Sorry, but that's not the way it works. If YOU want to prove your point it's YOU that has to do the research not us.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
thagrol
Posts: 1849
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 1:51 pm

davidcoton wrote:
Sat Aug 17, 2019 1:40 pm
You really have not understood how swap works. The swap file (or partition on some systems) reserves a chunk of memory on the SDCard
Pedant mode: that's storage not memory. :) Though admittedly many folks confuse the two.
This space unintentionally left blank.

User avatar
davidcoton
Posts: 4143
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 1:58 pm

thagrol wrote:
Sat Aug 17, 2019 1:51 pm
davidcoton wrote:
Sat Aug 17, 2019 1:40 pm
You really have not understood how swap works. The swap file (or partition on some systems) reserves a chunk of memory on the SDCard
Pedant mode: that's storage not memory. :) Though admittedly many folks confuse the two.
Understand your quibble, but actually my SDCards are better memory than RAM, because the stored data is not lost when power is removed. In any case it is irrelevant to the main argument, and to swap data in particular.
Signature retired

User avatar
PeterO
Posts: 5019
Joined: Sun Jul 22, 2012 4:14 pm

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 2:01 pm

davidcoton wrote:
Sat Aug 17, 2019 1:58 pm
Understand your quibble, but actually my SDCards are better memory than RAM, because the stored data is not lost when power is removed.
Bring back core stores ! :lol:
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
rpdom
Posts: 15204
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 2:09 pm

PeterO wrote:
Sat Aug 17, 2019 12:38 pm
It's counterintuitive, and a well known fact since the 1990s.
Every Unix and Linux system I've used since the early 1980s has had swap space. I've managed some large systems where swap has allowed them to keep running during peaks in load which would have otherwise brought them to a standstill.

PeterO
In a similar vein, I've worked on a mainframe system where certain procedures "swapped" to tape when there wasn't enough disk space for temporary files to be created. It very rarely happened, and when it did it usually failed. I was in charge one day when it did happen and used every free tape drive. It actually worked and my colleagues didn't believe me when I told them later.

PiGraham
Posts: 3608
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 2:14 pm

PeterO wrote:
Sat Aug 17, 2019 12:45 pm
PiGraham wrote:
Sat Aug 17, 2019 12:37 pm
This is an interesting article on swap space.

It may not negatively affect performance to have swap enabled, but I wonder if increases wear on an SD card even if you have enough RAM.
I doubt you could measure the effect. I think writting all those log files in /var causes more wear and tear to the SD card.

PeterO

Quite possibly, but you can disable logging.


Indeed you can diable writing entirely which means no swapping.

PiGraham
Posts: 3608
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 2:22 pm

davidcoton wrote:
Sat Aug 17, 2019 1:40 pm
The swap file (or partition on some systems) reserves a chunk of memory on the SDCard or SSD/HDD that can be used by the OS. That requires some startup time, but no run time. It is only actually used when the system runs short of RAM, which may be never.
Are you sure that is the case? The Sysadmin article I quoted earlier says the opposite, that swap is used to optimise caches, even when there is. strictly speaking, enough RAM.


I don't know, but the guy seemed credible and what he wrote made sense.

PiGraham
Posts: 3608
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 2:29 pm

thagrol wrote:
Sat Aug 17, 2019 1:51 pm
davidcoton wrote:
Sat Aug 17, 2019 1:40 pm
You really have not understood how swap works. The swap file (or partition on some systems) reserves a chunk of memory on the SDCard
Pedant mode: that's storage not memory. :) Though admittedly many folks confuse the two.
Was that pedant mode flag a global?

memory is storage, storage is memory and SD cards are built with flash memory chips, so your pedantic distinction isn't a hard and fast thing.
The term "memory", meaning "primary storage" or "main memory", is often associated with addressable semiconductor memory, i.e. integrated circuits consisting of silicon-based MOS transistors, used for example as primary storage but also other purposes in computers and other digital electronic devices. There are two main kinds of semiconductor memory, volatile and non-volatile. Examples of non-volatile memory are flash memory (used as secondary memory) and ROM, PROM, EPROM and EEPROM memory (used for storing firmware such as BIOS).
https://en.wikipedia.org/wiki/Computer_memory

User avatar
thagrol
Posts: 1849
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 3:22 pm

PiGraham wrote:
Sat Aug 17, 2019 2:29 pm
memory is storage, storage is memory and SD cards are built with flash memory chips, so your pedantic distinction isn't a hard and fast thing.
I never said it was. However in my experience confusing volatile RAM with non-volatile storage (be it flash or spinning rust) and refering to both as "memory" is very common amoung lay people and bloody confusing.

With the main topic of this thread and someone's obvious misunderstanding of how swap space works I though it worth pointing out the distinction. I wasn't being specific about SD cards, I was trying to point out the confusion caused by using a vague term like memory to refer to fast, volatile RAM and slow, persistant storage.

My appologies if I offended anyone or further muddied the waters.
This space unintentionally left blank.

User avatar
davidcoton
Posts: 4143
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 3:46 pm

PiGraham wrote:
Sat Aug 17, 2019 2:22 pm
davidcoton wrote:
Sat Aug 17, 2019 1:40 pm
The swap file (or partition on some systems) reserves a chunk of memory on the SDCard or SSD/HDD that can be used by the OS. That requires some startup time, but no run time. It is only actually used when the system runs short of RAM, which may be never.
Are you sure that is the case? The Sysadmin article I quoted earlier says the opposite, that swap is used to optimise caches, even when there is. strictly speaking, enough RAM.

I don't know, but the guy seemed credible and what he wrote made sense.
Like you, I don't know. But my understanding is that cacheing should not in itself require swapping. Cacheing uses the specialist fast cache RAM (L1 and L2), because by its nature cache memory needs to be faster than main RAM. Clearing extra main RAM for cache is pointless. If RAM is available, it would be silly to use SDCard or even SSD even for low-use pages. And if RAM isn't available, the system is going to need swap space (or other more drastic measures) anyway.

Look at the evidence on your own Pi. Does "free -m" show swap memory in use, before the main memory is full?
Signature retired

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12228
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 3:51 pm

Memory in the form of RAM, SRAM, (EE)PROM, or FLASH ROM is directly connected to the CPU, and is part of its MEMORY MAP.
Storage is on a secondary peripheral device, is accessed slowly trough an I/O channel, and is used for permanent storage of data.

please think of our primary rule to be polite to others, or I have to intervene. :mrgreen:

User avatar
PeterO
Posts: 5019
Joined: Sun Jul 22, 2012 4:14 pm

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 3:58 pm

davidcoton wrote:
Sat Aug 17, 2019 3:46 pm
Like you, I don't know. But my understanding is that cacheing should not in itself require swapping. Cacheing uses the specialist fast cache RAM (L1 and L2), because by its nature cache memory needs to be faster than main RAM.
The cache in this case is not the L1/L2 memory caches in the SoC, but the main memory (RAM) that is used to cache disk sectors. That shows up under "buff/cache" in the free output....

Code: Select all

 
 petero@EliteDesktop1:~$ free
              total        used        free      shared  buff/cache   available
Mem:       12185048     3166448     5467792      636640     3550808     8134900
Swap:       2097148           0     2097148
petero@EliteDesktop1:~$ 
There is going to be interaction between disk caching policy and swapping policy because they both involve memory (RAM) usage and disk accesses.
I think that's what the article was trying to explain (though I'm not sure it does it very well).

PeterO
Last edited by PeterO on Sat Aug 17, 2019 4:18 pm, edited 1 time in total.
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
davidcoton
Posts: 4143
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 4:06 pm

PeterO wrote:
Sat Aug 17, 2019 3:58 pm
davidcoton wrote:
Sat Aug 17, 2019 3:46 pm
Like you, I don't know. But my understanding is that cacheing should not in itself require swapping. Cacheing uses the specialist fast cache RAM (L1 and L2), because by its nature cache memory needs to be faster than main RAM.
The cache in this case is not the L1/L2 memory caches in the SoC, but the main memory (RAM) that is used to cache disk sectors. That shows up under "buff/cache" in the free output....

Code: Select all

 
 petero@EliteDesktop1:~$ free
              total        used        free      shared  buff/cache   available
Mem:       12185048     3166448     5467792      636640     3550808     8134900
Swap:       2097148           0     2097148
petero@EliteDesktop1:~$ 
The is going to be interaction between disk caching policy and swapping policy because they both involve memory (RAM) usage and disk accesses.
I think that's what the article was trying to explain (though I'm not sure it does it very well).

PeterO
Ah, that explains it. So cacheing disk sectors in memory pages will hasten swapping, but still swapping should not start until all RAM is used. That is, Swap used remains 0 until Mem Available approaches zero.
Signature retired

User avatar
davidcoton
Posts: 4143
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 4:09 pm

thagrol wrote:My appologies if I offended anyone
Didn't offend me, I can do [pedant] myself at times.
Signature retired

User avatar
thagrol
Posts: 1849
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 4:12 pm

davidcoton wrote:
Sat Aug 17, 2019 3:46 pm
PiGraham wrote:
Sat Aug 17, 2019 2:22 pm
davidcoton wrote:
Sat Aug 17, 2019 1:40 pm
The swap file (or partition on some systems) reserves a chunk of memory on the SDCard or SSD/HDD that can be used by the OS. That requires some startup time, but no run time. It is only actually used when the system runs short of RAM, which may be never.
Are you sure that is the case? The Sysadmin article I quoted earlier says the opposite, that swap is used to optimise caches, even when there is. strictly speaking, enough RAM.

I don't know, but the guy seemed credible and what he wrote made sense.
Like you, I don't know. But my understanding is that cacheing should not in itself require swapping. Cacheing uses the specialist fast cache RAM (L1 and L2), because by its nature cache memory needs to be faster than main RAM. Clearing extra main RAM for cache is pointless. If RAM is available, it would be silly to use SDCard or even SSD even for low-use pages. And if RAM isn't available, the system is going to need swap space (or other more drastic measures) anyway.
That's probably not the sort of caching being talked about. L1/L2 (and if present L3) is internal to the CPU and not (usually) OS controlled though I could be wrong here.

It's more likely that the caching being refered to is the OS using otherwise unused RAM to cache data from the disc (whatever type of disc it is) to improve access time for frequently used files and directories. That may be routed through the virtual memory subsystem, at least to the extent that the OS needs to know which pages of RAM can be thrown away when a higher priority demand on RAM is made. This is even more probable when using memory mapped I/O (mapping a file into the OS's address space) though in that case I'd expect access to be directly to the file rather than the file being first copied into swap space.

Whether that hits the swap space or not I can't say. I'm not intimate with the linux kernel and its low level drivers.
This space unintentionally left blank.

User avatar
thagrol
Posts: 1849
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 4:13 pm

davidcoton wrote:
Sat Aug 17, 2019 4:06 pm
Ah, that explains it. So cacheing disk sectors in memory pages will hasten swapping, but still swapping should not start until all RAM is used. That is, Swap used remains 0 until Mem Available approaches zero.
Maybe but I'd expect the disc cache pages to be thrown away rather than swapped out at least for a read cache. Their content can be reread from the disc as needed.
This space unintentionally left blank.

User avatar
davidcoton
Posts: 4143
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 4:21 pm

thagrol wrote:
Sat Aug 17, 2019 4:13 pm
davidcoton wrote:
Sat Aug 17, 2019 4:06 pm
Ah, that explains it. So cacheing disk sectors in memory pages will hasten swapping, but still swapping should not start until all RAM is used. That is, Swap used remains 0 until Mem Available approaches zero.
Maybe but I'd expect the disc cache pages to be thrown away rather than swapped out at least for a read cache. Their content can be reread from the disc as needed.
That would be my assumption, but low-use memory pages (other than cache) could be swapped to make room for disk cache in some circumstances (at least in a server -- not sure it would happen on a typical desktop). It still should not happen while RAM is available.
Signature retired

User avatar
rpdom
Posts: 15204
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Permanently disable swap on Raspbian Buster

Sat Aug 17, 2019 4:52 pm

davidcoton wrote:
Sat Aug 17, 2019 4:21 pm
That would be my assumption, but low-use memory pages (other than cache) could be swapped to make room for disk cache in some circumstances (at least in a server -- not sure it would happen on a typical desktop). It still should not happen while RAM is available.
That's what the "swapiness" parameter is for. It configures how "keen" the system is to swapping out blocks of memory that haven't been used for a while. On Raspbian this is set to a very low value to prevent unnecessary swapping to SD card.

PiGraham
Posts: 3608
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Permanently disable swap on Raspbian Buster

Sun Aug 18, 2019 8:47 am

This outlines how swappiness relates to swapfile use when there is available RAM.
What is the default for Raspbian?
The default value of vm.swappiness is 60 and represents the percentage of the free memory before activating swap. The lower the value, the less swapping is used and the more memory pages are kept in physical memory.
The value of 60 is a compromise that works well for modern desktop systems. A smaller value is a recommended option for a server system, instead. As the Red Hat Performance Tuning manual points out [8], a smaller swappiness value is recommended for database workloads. For example, for Oracle databases, Red Hat recommends a swappiness value of 10. In contrast, for MariaDB databases, it is recommended to set swappiness to a value of 1 [9].
Changing the value directly influences the performance of the Linux system. These values are defined:

* 0: swap is disable
* 1: minimum amount of swapping without disabling it entirely
* 10: recommended value to improve performance when sufficient memory exists in a system
* 100: aggressive swapping

https://linuxhint.com/understanding_vm_swappiness/

User avatar
rpdom
Posts: 15204
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Permanently disable swap on Raspbian Buster

Sun Aug 18, 2019 9:00 am

Hmm, ok. Looks like I sit corrected. The figure for swappiness on the Pi seems to be the default of 60 now (cat /proc/sys/vm/swappiness). It used to be something like 1 to prevent swap to the SD card except in extreme cases.

Still, none of my Pi are swapping. Even the one with 256MB.

ProDigit
Posts: 374
Joined: Tue Aug 30, 2011 1:24 am

Re: Permanently disable swap on Raspbian Buster

Sun Aug 18, 2019 12:41 pm

thagrol wrote:
Sat Aug 17, 2019 1:27 pm
ProDigit wrote:
Sat Aug 17, 2019 1:21 pm
I really can't explain any better, but if you're not Willing to do the research, and just GOOGLE the topic, I really can't do much about that.
Couple of reasons that won't help your (or my) position:
  • Traditionally it's your job to support your argument with evidence not mine.
  • There's no guarantee google will return the same results for me as it did for you and in the same order. We might not use the same search terms and google does result filtering based on your search history too.
  • I don't use google. (Because of thier logging but that's an entirely different discussion)
Not true in case of fact.
Then you'll have to read up on fact. It's not my job to provide you the proof you can provide yourself.

In fact, you'd have to provide the proof that any opposing (counterintuitive) thought could be true.
In my case, there are thousands of documents supporting the delete swap theory.
In your case, there aren't many, if any at all, supporting the idea of swap improving the speed, most of these documents are pre-1990's era, when RAM was 512MB or less.

How do you know the system doesn't use swap? Or are you just presuming this?
Is there any evidence on that claim?
The system may not use the swap, but it also may.
If it does access the swap, it will definitely slow down the whole system!
When deleting the swap, it guarantees it doesn't use the swap, and the only slow downs will happen when one is running out of memory.

There's no reason to have a swap file on Raspbian when you're having 1-4GB of RAM (unless you go crazy, like having animated desktop backgrounds, 3D accelerated aero-like themes, etc...).
I can do 95% of my desktop and internet needs within the confines of the 1GB of Ram my Pi3B+ offers.
The only things I can't do within the constrictions of the RAM, is run large, bloated software, or run a browser with multiple tabs and high definition video (which I barely ever do). For this I'd need a swap file. But I'd rather do these things on a laptop or desktop, or trim my OS to fit the device better.

To get Raspbian work properly on 512MB of the Pi Zero, it gets tough, and one might need a swap for watching Youtube video, or having more than 3 tabs opened. But then again, the Pi Zero wasn't really made to run Raspbian Desktop os.

User avatar
PeterO
Posts: 5019
Joined: Sun Jul 22, 2012 4:14 pm

Re: Permanently disable swap on Raspbian Buster

Sun Aug 18, 2019 12:46 pm

ProDigit wrote:
Sun Aug 18, 2019 12:41 pm
Then you'll have to read up on fact. It's not my job to provide you the proof you can provide yourself.
Your point of view, your job to provide the proof.
How do you not understand this ?

Oh and you're still not understanding the arguments because "In your case, there aren't many, if any at all, supporting the idea of swap improving the speed, " is not our case at all (and we've told you that several times now).


It's not hard to do, just post some of the 1000s of links you claim to have found on Google.

Like this ...
https://www.redhat.com/en/blog/do-we-re ... rn-systems
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
rpdom
Posts: 15204
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Permanently disable swap on Raspbian Buster

Sun Aug 18, 2019 1:02 pm

PeterO wrote:
Sun Aug 18, 2019 12:46 pm
Like this ...
https://www.redhat.com/en/blog/do-we-re ... rn-systems
PeterO
Interesting the the "recommended" amount of swap nowadays is 20% of RAM size. Back in the "stone age" of Unix it was about 120% of RAM size. But RAM was slow and disks were still slower, but the systems I started on had 32 or 64MB of RAM and 300MB of disk for 16-32 users. CPUs ran at 25 or 33MHz (68030/68040 based systems).

I believe with swappiness set high the system will copy idle ram pages to swap during quiet periods so it can drop the RAM copy if it needs the memory for something else and page it back in from swap if needed. That is better than waiting until it is absolutely necessary to swap that page out to keep the system running, as just swapping it out will take extra time, but none if a copy of it is already in swap.

User avatar
thagrol
Posts: 1849
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Permanently disable swap on Raspbian Buster

Sun Aug 18, 2019 1:46 pm

ProDigit wrote:
Sun Aug 18, 2019 12:41 pm
thagrol wrote:
Sat Aug 17, 2019 1:27 pm
ProDigit wrote:
Sat Aug 17, 2019 1:21 pm
I really can't explain any better, but if you're not Willing to do the research, and just GOOGLE the topic, I really can't do much about that.
Couple of reasons that won't help your (or my) position:
  • Traditionally it's your job to support your argument with evidence not mine.
  • There's no guarantee google will return the same results for me as it did for you and in the same order. We might not use the same search terms and google does result filtering based on your search history too.
  • I don't use google. (Because of thier logging but that's an entirely different discussion)
Not true in case of fact.
Then you'll have to read up on fact. It's not my job to provide you the proof you can provide yourself.
I don't quite follow you here.
Are you claiming it's not true that anyone needs to provide evidence to support thier position? That it's not true that different search terms (you haven't told us which terms you used) provide different results? That google doesn't tailor search results based on your past history? That different search engines don't return diferent results.

As for who has to provide evidence to support their position, look at it this way: it's not the defense's job to provide evidence to support the prosecution's case. That's what you seem to expect us to be doing.
In fact, you'd have to provide the proof that any opposing (counterintuitive) thought could be true.
In my case, there are thousands of documents supporting the delete swap theory.
So provide links to some of them
In your case, there aren't many, if any at all, supporting the idea of swap improving the speed, most of these documents are pre-1990's era, when RAM was 512MB or less.
Have you actually read and understood any of my posts?

I'm not claiming that swap increases performance. I've never said that and in one of my earlier post I have stated explictly that swap reduces performance.

What I'm trying to explain, which you are persistantly mis-interpreting is that the presence of a swap file or swap partition does not mean it is being used (see my earlier post re the free command) and that an unused swap file/partition has no negative effect on system performance.
How do you know the system doesn't use swap? Or are you just presuming this?

Code: Select all

free -h
Is there any evidence on that claim?

Code: Select all

free -h
and see my earlier posts.
The system may not use the swap, but it also may.
If it does access the swap, it will definitely slow down the whole system!
When deleting the swap, it guarantees it doesn't use the swap, and the only slow downs will happen when one is running out of memory.
No. Without swap when the system runs out of RAM you'll get hangs, crashes and other instabilities.
There's no reason to have a swap file on Raspbian when you're having 1-4GB of RAM (unless you go crazy, like having animated desktop backgrounds, 3D accelerated aero-like themes, etc...).
There's no reason not to either.
I can do 95% of my desktop and internet needs within the confines of the 1GB of Ram my Pi3B+ offers.
The only things I can't do within the constrictions of the RAM, is run large, bloated software, or run a browser with multiple tabs and high definition video (which I barely ever do). For this I'd need a swap file. But I'd rather do these things on a laptop or desktop, or trim my OS to fit the device better.
That 5% is why you should have a swap file.

What on earth make you think your laptop will handle that 5% any better? If it does it's because it has swap enabled (that's the default on most modern OS).

Don't believe me? Try disabling swap on your laptop... (and that experiment would only be even partially valid if both your laptop and Pi have the same amunt of RAM).
To get Raspbian work properly on 512MB of the Pi Zero, it gets tough, and one might need a swap for watching Youtube video, or having more than 3 tabs opened. But then again, the Pi Zero wasn't really made to run Raspbian Desktop os.
Maybe, I wouldn't know. All my Pi are running headless though I did have a desktop running on a 1B rev 1 back in the day (that's 256MB RAM for what it's worth).
This space unintentionally left blank.

Return to “Troubleshooting”