How to fix high memory usage error on Linux

Your server is responding slowly to the website, cannot launch applications, etc.? Are you experiencing high memory usage error? This article will guide you how to fix this error on Linux.

  1. Memory management to keep Linux from using too much RAM
  2. How to check the available memory in Ubuntu
  3. Learn about swapping Linux memory space

Before you start trying to free up memory, you need to make sure that something is actually using memory. Due to the way Linux handles memory, it seems that some application or process is using all available memory.

How to fix high memory usage error on Linux Picture 1

By default, Linux sets aside unused memory to cache, which really helps speed up the computer. If you're having trouble using memory, it's possible that a problematic service or application actually uses more RAM than necessary.

Diagnosis of memory usage

To diagnose memory, you need to use a number of different commands. The top command is used to find applications that use too much RAM.

You can use the free and ps commands to help diagnose RAM problems. To use free , run the following command:

 free -m 

You will see the total and used numbers are similar. This is normal behavior of Linux, so you do not need to worry about it. It is important to note that the part used in the row of buffers / cached , this is the memory of the application and services actually used.

How to fix high memory usage error on Linux Picture 2

You can use the ps command similar to top to determine which application is using the most memory. To check, run the following command:

 ps aux 

The above command will display the application using the most memory and its process ID.

How to fix high memory usage error on Linux Picture 3

Fix high memory usage error

There are several common culprits that cause high memory usage on Linux. One of the main causes is Java. When using the official Java runtime environment or alternatives provided by GNU, it can lead to high memory usage. If you encounter this problem on the server, it may be caused by JBoss or Tomcat. You will find its configuration file similar to:

 /usr/local/jboss/bin/run.conf /usr/local/tomcat/bin/setenv.sh 

Other causes may be Apache or MySQL. You can check the log file to see errors or warnings from these services.

Once you know the cause, you can easily fix the problem.

I wish you successful implementation!

4.1 ★ | 15 Vote

May be interested

  • How to downgrade kernel in LinuxPhoto of How to downgrade kernel in Linux
    linux life is determined by the kernel. if you are familiar with how gnu / linux works, linux is essentially the kernel. everything else is just a communication tool with it.
  • Best Linux monitoring tool & softwarePhoto of Best Linux monitoring tool & software
    like windows, the infrastructure that runs on linux must also be monitored, which is why today tipsmake.com summarizes the best monitoring tools and software available today.
  • 4 reputable Linux hardware manufacturers for open source enthusiastsPhoto of 4 reputable Linux hardware manufacturers for open source enthusiasts
    now, more and more computers that come with linux come pre-installed, which you can find. they are suitable for a wide range of users and different financial capabilities.
  • 10 software should install on UbuntuPhoto of 10 software should install on Ubuntu
    you just moved from windows to ubuntu and wondered which ubuntu application is best and which software to install? below are the applications that should be installed on ubuntu after a fresh install.
  • 5 ways Librem 5 phones affect Linux desktopPhoto of 5 ways Librem 5 phones affect Linux desktop
    the purism librem 5 phone has been around for a long time and its impact can be clearly seen on linux desktops. this effect is most noticeable if you use the gnome desktop environment on ubuntu or fedora.
  • How to manage the priority of I / O process in LinuxPhoto of How to manage the priority of I / O process in Linux
    if you've done this, you definitely notice that the system became less responsive during that time. on linux, you can avoid this with the help of the ionice command.