Menu
PHP BABA LOGO
  • Home
  • About
PHP BABA LOGO

Create a swap memory in Linux

Posted on December 2, 2020December 2, 2020

Swap memory is like RAM, in Linux is used when the amount of RAM is full. If the system needs more memory resources and the RAM is full then, other inactive pages in RAM are moved to the swap memory. While swap space can help machines with a small amount of RAM. Swap memory creates by some part of Hard drive.

You need to install htop monitoring features for check memory uses.

Following commands will create 4 GB of swap memory:

  1. sudo swapon –show
  2. sudo fallocate -l 4G /swapfile
  3. sudo chmod 600 /swapfile
  4. sudo mkswap /swapfile
  5. sudo swapon /swapfile
  6. sudo nano /etc/fstab (add this line /swapfile swap swap defaults 0 0)
  7. sudo swapon –show
  8. htop

Categories

  • Docker
  • Git
  • Interview Questions
  • Laravel
  • Linux
  • php
  • Salesforce

Recent Posts

  • Salesforce interview question
  • Platform Developer I Certification Maintenance (Winter ’25)
  • Batch Class in Salesforce
  • Platform Developer I Certification Maintenance (Winter ’24) Get Hands-on with Bind Variables in a SOQL Query
  • How to check Salesforce current release version

Recent Posts

  • Salesforce interview question September 7, 2025
  • Platform Developer I Certification Maintenance (Winter ’25) July 16, 2025
  • Batch Class in Salesforce January 25, 2024
  • Platform Developer I Certification Maintenance (Winter ’24) Get Hands-on with Bind Variables in a SOQL Query December 19, 2023
  • How to check Salesforce current release version January 12, 2023
©2025 The Tech Paper | Powered by Abhinav Trivedi