• DevOps
    Case Study

    How we built a resilient multi-account, multi-cloud solution for a Health Tech service provider!

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How we built a scalable Odoo solution for a Travel Tech service provider!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    How we built a scalable Odoo solution for TravelTech service provider!

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Contact Us

Connect with us!


LinkedInFacebookXInstagramYouTube

aws partneraws advanced partner
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy
Everything about SWAP in Linux – why do we need swapping ?

Everything about SWAP in Linux – why do we need swapping ?

Daniel Wren

  • 4 min read
Everything about SWAP in Linux – why do we need swapping ?

Generating audio, please wait...

Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. Swap space is located on hard drives, which have a slower access time than physical memory and is often calculated as twice the RAM (for less than 32Gb RAM). Swap space need not exceed more than 16Gb or maximum physical memory.

Why do we need swap ?

  • When certain applications need more memory than that can be allocated physically

  • Hibernation or suspend action would flush the entire RAM to the swap space

What is swappiness and how do I change it?

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. As disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory. It is better to have a value somewhere in the middle.

1. swappiness can have a value of between 0 and 100

2. swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible

Promotional banner

3. swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache

Is it paging or swapping happening in Linux ?

Letʼs take a look at a few important concepts related to memory starting with the concept of virtual memory. Operating system uses capabilities of the CPU to make it appear as though you have more memory than you really do. This is the concept of virtual memory which is nothing but an abstraction of the main memory. Linux implements this concept of virtual memory using something called page. It extends the available memory of the computer by storing the inactive pages of the RAM on a disk. Whenever the pages are required, it is brought back to the RAM.

Swap memory or swap space is a part of the hard disk drive that is used as virtual memory. Thus, both terms are also used interchangeably. Each page is 4Kb in size and is considered as the basic unit of memory. The CPU also helps the kernel by recognising when the process tries to access a page that is not yet in memory. It is the kernel’s job to figure out which process it was, what page it was, and to load the appropriate page. Kernel locates each page in the physical memory or in the swap space. The kernel transfers data between the RAM and the disk and updates the paging tables as it goes along so that the entry for the virtual address points to a physical page in memory and this is called Paging.

The pages that have not been accessed since a long time are sent to the swap space area. The process is referred to as swapping out. In case the same page is required, it is swapped in physical memory by swapping out a different page. Thus, one can conclude that swap memory and virtual memory are interconnected as swap memory is used for the technique of virtual memory.

Swapping refers to the case where the on-disk data is in a swap disk or swap area. Paging can also be done between RAM and a file, and in this case it’s usually not referred to as swapping.

The answer to the question is Linux does the both. To make it better, Linux does swapping in addition to paging.

Let us take care of your servers 24/7/365. Get rid of all the hassles of Server Management.

  • Linux
  • server
  • Sever management
Promotional banner
Promotional banner

How to install node.js on your shared server?

How to install node.js on your shared server?
  • server
  • Sever management
logo

How to secure SSH access to your server using TORʼs hidden service ?

How to secure SSH access to your server using TORʼs hidden service ?
  • Linux
logo

How to stand out from the crowd by providing 24*7 customer support?

How to stand out from the crowd by providing 24*7 customer support?
  • Customer Care
logo

Init v/s Systemd

Init v/s Systemd
  • Linux
logo

Posts by Daniel Wren

An innovative and dedicated IT professional who is very curious to solve and find solutions to seemingly difficult tasks.