Understanding swapiness parameter in Linux
Introduction In an earlier article, we demonstrated how we could calculate and report the amount of swap memory used by an individual process. In this article, we will explain a kernel parameter related to the use to swap memory. This kernel parameter is called swapiness. Before we talk about swapiness, we’ll briefly explain the concepts of swapping and paging. An overview of memory management in Linux A process normally runs on physical memory where the memory is divided into sets of pages. A page is a 4kb area of memory and is the basic unit of memory with which both kernel and CPU deal. This page size is tunable. Operating systems use virtual memory which is a memory management technique wherein RAM and swap memory are combined gives an application program the impression that it has contiguous working memory. This memory management implementation allows processes requiring a large amount of memory of fork even if the required amount of RAM is not available at that point in time. Swap space: This is storage space allocated on a portion of or the entire hard disk which is used by the operating system to store data pages that are currently not needed. This swap space can be a partition as well as swap file. Although allocating swap space using swap files is not recommended. Swapping and Paging To swap a process...
Read More