How to reduce the physical memory / RAM on Linux OS

In order to perform the changes follow the above instructions:

  1. Log into your server with SSH (root)
  2. Open the Terminal / Console.
  3. Edit the "/etc/default/grub" file with any editor:

Now add mem=2G in GRUB_CMDLINE_LINUX_DEFAULT. Make sure to replace your own limit with mem=2G

GRUB_CMDLINE_LINUX_DEFAULT="mem=2G"

When the changes are done, run the command:

update-grub2

To apply the changes! Now check the RAM limit with df / free. The available RAM limit should be reduced now!

Tip: If update-grub2 does not exists on your server, execute: grub2-mkconfig -o /boot/grub2/grub.cfg ; reboot

Make sure to revert the changes once your work is done if you want to utilize the full RAM for your applications!

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to restrict direct root access in Linux

We can do it just in two steps. Step One: At first we will create new root user as follows (for...

How to extract .tar.gz files in Linux/UNIX OS

A tarball is a group of files that are bundled together using the tar command. Use the...

How to add welcome message when SSH start?

You need to change the contents of /etc/motd. Unfortunately, by default, /etc/motd is a link to...

How to change root password when SSH logged in

Run the following command: passwd Now type your new passwordOnce done, retype new passwordDone!...

How to install Pinguzo on any Linux/UNIX OS

Login to Pinguzo panel using Softaculous account or create an account of Pinguzo To add new...