Questions tagged [swap]

Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory(RAM) and the swap space is the amount of virtual memory available. Linux has two forms of swap space: the swap partition and the swap file.

From linux.com All about swap space:

Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.

Swapping is necessary for two important reasons. First, when the system requires more memory than is physically available, the kernel swaps out less used pages and gives memory to the current application (process) that needs the memory immediately. Second, a significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache. However, swapping does have a downside. Compared to memory, disks are very slow.

Linux has two forms of swap space: the swap partition and the swap file. The swap partition is an independent section of the hard disk used solely for swapping; no other files can reside there. The swap file is a special file in the filesystem that resides amongst your system and data files.

Swap space size should be either similar to system RAM or double it's size.

340 questions
-1
votes
1 answer

Manually trigger swappiness?

I am playing around with ZFS on Proxmox and have noticed that swappiness never seems to kick in. The swappiness value is currently set to 50 but never swaps unless I reach 100% RAM usage acting as if swappiness is set to 0. How can I manually force…
Toodarday
  • 185
  • 1
  • 7
-2
votes
1 answer

Moving Processes to and from Swap

Referring to Moving a process to and from swap and other answers which talk about moving processes to and from the swap space for Linux, none of them give a prolific description of the pros and cons of doing so. Please explain this. Please also…
-2
votes
1 answer

Increasing swap on RAM-limited VPS used for calculations

I'm using a VPS for some computationally heavy tasks but not to host a publicly-facing website. The author of the application I'm using recommends running the jar with 8GB of RAM, but adding those physical resources to my instance would quadruple…
raphael
  • 159
  • 8
-2
votes
3 answers

how to check how much memory take process

As all know in Linux machines we have RAM memory and swap memory. My first question is: What the reason that the swap memory is increasing – because high level of RAM usage or something else? Second - is it possible to verify how much memory a…
maihabunash
  • 443
  • 1
  • 11
  • 25
-2
votes
1 answer

Improve LAMP performance Ubuntu 12.0.4

cpu 1.3% mem 476/490MB swap 347/511mb tasks: 43, 29 thr; 1 running load average: 0.10 0.08 0.06 via htop:
/usr/sbin/apache2 -k start (listed 8x @ 8.1% mem each) /usr/sbin/mysqld (listed 24x @ 2.1% mem each) if I restart apache, pages load…
Charles
  • 41
  • 1
  • 1
  • 5
-2
votes
3 answers

Linux makes cache for swap. what for?

It looks like joke: swapfile on "ramdysk" in 64bits system? I look into file: /proc/meminfo and made some investigation. Look for line: SwapCached: nnnnn kB . One is what I don't understand. What for linux kernel caches swap? What for caching…
Znik
  • 338
  • 1
  • 3
  • 12
-3
votes
1 answer

My server virtual memory full

occasionally my server hits 100% usage on virtual memory and I don't know if that is something alarming or not? ( this happends gradualy to fill to that percent over 1-2 weeks from clean swap) I usually resolve this issue like this: swapoff -a &&…
-3
votes
1 answer

Does swap on 32-bit OS with 4 GB make sense?

Does having swap space makes sense if I have a 32 bit OS (Linux) and 4 GB RAM already? As it would have to be addressable with a 32 bit address, which are already all "used up" by the RAM, would swap even be accessible to the operating system?
-4
votes
1 answer

How to control the memory usage of a swap partiotion?

Thats pretty much the quesiton: how can I control the memory usage of each swap partiotion, say /etc/sa5?
alfish
  • 3,027
  • 15
  • 45
  • 68
-7
votes
1 answer

Am I having too much swap?

Am I having too much swap space if my server is a 8GB physical ram and I would like to set my swap to 16GB. I am planning to use this server for shared hosting would like know.
Jose Vasquez
  • 17
  • 1
  • 1
  • 2
1 2 3
22
23