Categories
Planning

How to tell what type of memory your linux pc has installed

Lowell Heddings
How to tell what type of memory your linux pc has installedLowell Heddings
Founder and CEO

Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work. Read more.

If you are looking to upgrade the memory in your Linux PC, you are probably wondering how many open slots you have, what type of memory is already installed, and what you need to buy for an upgrade… without having to open your computer.

Since you shouldn’t have to open up the computer just to figure out what you have installed, here’s how to detect the type of memory your Linux PC has installed without having to open up the case.

How to Show the Installed Memory

Open up a terminal window and type in the following command:

How to tell what type of memory your linux pc has installed

At the beginning of the output you’ll see the maximum memory size allowed by your PC, which is important—you can’t put two 4GB memory modules into a machine that only allows a total of 4GB of RAM.

Once you’ve scrolled down a little further, you’ll see the rest of the memory details for each piece of RAM that’s installed. Here’s a sample from one of my Linux boxes, and I’ve highlighted the important bits in bold text.

Handle 0x0120, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x011F
Error Information Handle: No Error
Total Width: 64 bits
Data Width: 64 bits
Size: 512 MB
Form Factor: DIMM
Set: None
Locator: DIMM0
Bank Locator: BANK 0
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz (1.5 ns)
Manufacturer: 0x7F7F7F0B00000000
Serial Number: 0xC773441A
Asset Tag: Unknown
Part Number: 0x4E543531325436345548384230464E2D3343

You’ll see that I’ve got DDR2-667 RAM installed on the system, so if I’m going to upgrade, I’ll need to find RAM that matches.

Other Options for Finding the Memory Type

Here’s a few other options that you can use:

  • You can look up the specs for your system to figure out what memory types your computer takes. I usually google for “modelnumber specs”, for instance I’d type in “nc8430 specs”.
  • Pull out the manual for your computer or motherboard, and take a look at your receipts to figure out what you bought last time.
  • If you built a computer with parts from Newegg, you can look at your order history to re-order the exact same memory module if you know you have empty slots.
  • If you are running Mac OS X, you can just look under your “About this Mac” and then click on More Info.

If you’re running Windows instead, make sure to read our article on how to tell what type of memory your Windows PC has installed.

  • › How to Add Images to Questions in Google Forms
  • › How to Delete Your Photos on Facebook
  • › Razer Thinks You Want a PC Gaming Headset That Vibrates
  • › How to Get a Link to a Photo or Video on Instagram
  • › The Fix for Slow AMD Processors on Windows 11 Is Here

How to tell what type of memory your linux pc has installed Lowell Heddings
Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work.
Read Full Bio »

It is essential that your Linux system runs at an optimal level. A few simple terminal commands provide access to all relevant information and help you monitor memory statistics.

In this tutorial, learn five powerful commands to check memory usage in Linux.

We also provide detailed explanations of what they do and more importantly, how to interpret the results. The commands will work with nearly all Linux distributions. In this instance, the commands and the results are presented using Ubuntu 18.04

How to tell what type of memory your linux pc has installed

  • Access to a command line / terminal
  • User with sudo privileges
  • The apt package manager

Commands to Check Memory Use in Linux

cat Command to Show Linux Memory Information

Entering cat /proc/meminfo in your terminal opens the /proc/meminfo file.

This is a virtual file that reports the amount of available and used memory. It contains real-time information about the system’s memory usage as well as the buffers and shared memory used by the kernel. The output might differ slightly based on the architecture and operating system in question.

This is an example of what the /proc/meminfo file looks like in Ubuntu 18.04:

How to tell what type of memory your linux pc has installed

The terminal displays the information in kilobytes.

free Command to Display the Amount of Physical and Swap Memory

Typing free in your command terminal provides the following result:

The data represents the used/available memory and the swap memory figures in kilobytes.

The detailed description listed below provides an explanation for each value in case you need assistance in analyzing the results.

  • Procs
    • r: number of processes waiting for run time.
    • b: number of processes in uninterruptible sleep.
    • swpd: amount of virtual memory used.
    • free: amount of idle memory.
    • buff: the amount of memory used as buffers.
    • cache: amount of memory used as cache.
    • si: memory swapped in from disk (/s).
    • so: memory swapped to disk (/s).
    • bi: Blocks received from a block device (blocks/s).
    • bo: Blocks sent to a block device (blocks/s).
    • in: number of interrupts per second, including the clock.
    • cs: number of context switches per second.
    • us: Time spent running non-kernel code. (user time, including nice time)
    • sy: Time spent running kernel code. (system time)
    • id: Time spent idle. Before Linux 2.5.41, this includes IO-wait time.
    • wa: Time spent waiting for IO. Before Linux 2.5.41, included in idle.
    • st: Time stolen from a virtual machine. Before Linux 2.6.11, unknown.

    top Command to Check Memory Use

    The top command is useful to check memory and CPU usage per process. It displays information about:

    • uptime
    • average load
    • tasks running
    • number of users logged in
    • number of CPUs/CPU utilization
    • memory/swap system processes

    The data is continuously updated, which allows you to follow the processes in real-time.

    How to tell what type of memory your linux pc has installed

    Aside from providing you with essential memory information, the top command provides a limited interactive interface. It is possible to manipulate and configure operations by using command-line options.

    The man command in Linux man top provides a comprehensive list of all available variations.

    htop Command to Find Memory Load of Each Process

    The information the htop command provides is similar to the top command. However, the real advantage to the htop command is its user-friendly environment and improved controls.

    The command uses color for its output, provides full command lines for processes, as well as the option to scroll both vertically and horizontally.

    The following output appears:

    How to tell what type of memory your linux pc has installed

    1. The top segment provides summary information and contains graphic meters and text counters.
    2. The lower section structures the detailed data, per process. This allows you to perform actions on individual processes with ease.
    3. The shortcuts listed at the bottom of the screen will enable you to manipulate and customize the processes quickly and without the need to type specific commands.

    Note: If you run into “Command ‘htop’ not found” message when trying to run the htop command, you will need to install the htop function first:

    As an alternative, use the command below:

    Checking Memory Usage in Linux using the GUI

    Using a graphical interface for server administration is not common practice. However, certain data sets are much clearer, with a visual representation of memory usage.

    To access the System Monitor:

    1. Navigate to Show Applications.
    2. Enter System Monitor in the search bar and access the application.
    3. Select the Resources tab.
    4. A graphical overview of your memory consumption in real time, including historical information is displayed.

    How to tell what type of memory your linux pc has installed

    This guide provided several options to check memory usage on your Linux system. We learned that a single command provides an abundance of valuable data for future analysis. Learning to interpret the information correctly is critical.

    How to tell what type of memory your linux pc has installedIncreasing RAM is one of the easiest ways to speed up any computer if there are problems with reloading pages in the browser, applications are running too slow or there are other symptoms of insufficient RAM. Installing additional RAM is a simple procedure that can be managed without contacting the service center.

    However, it is necessary not only to install, but also to correctly select the new sticks for purchase. RAM differs in type, frequency and capacity. Before buying new RAM stick, you need to find out what RAM is installed in your computer, find the right one and purchase it.

    HOW TO CHOOSE RAM

    Selecting RAM for a computer is quite simple. Here will be only two cases possible:

      Your computer already has RAM and its volume needs to be expanded by installing an additional stick. In such a situation, it is desirable to acquire a stick that has its capacity corresponding to the one that is already installed in the computer. In addition, these two should not differ in type and frequency;
    • You are going to install new RAM to replace the old one. If new memory sticks are going to be installed in place of the old ones, it will be necessary to pay attention only to the support of the selected RAM from the motherboard and processor side.

    Most often, users are adding RAM to the computer, and they need to determine what memory is currently installed.

    HOW TO KNOW WHAT RAM IS INSTALLED IN MY COMPUTER

    There are dozens of ways to determine the main parameters of RAM installed in your computer. We are not going to discuss them all in one singe article, but let’s take a look at the most convenient and simple ones.

    VISUAL INSPECTION

    The easiest way to find out the main parameters of RAM installed in your computer is to inspect the RAM stick that is already there. To do this, you must first turn off your computer, then remove the cover and pull out the stick (to remove it, you will need to loosen the clips on both sides). It should have a sticker with all important information about the RAM.

    Advantages of visual inspection:

    • No need to turn your computer on and download third-party applications;
    • In addition to the basic RAM parameters you can find out its exact model.

    Disadvantages of visual inspection:

    • If the sticker on a RAM stick was torn off, the information will not be obtained;
    • Because of the cooling radiator placed right on a RAM stick some modern memory sticks do not have stickers with information on them;
    • This method is not suitable for laptops, since disassembling laptop housing is a very time-consuming procedure.

    BIOS MEANS

    Through BIOS or UEFI environment, you can determine the main parameters of RAM installed in your computer. To do this, you have to press Del before starting the operating system, that is, immediately after turning your computer on. It will let you to get to the BIOS settings. Then you have to act depending on the BIOS or UEFI version:

    • If we are talking about old BIOS versions, you need to look for information about RAM in the Memory Information column, which is located in the Chipset tab. Please note: in different BIOS versions RAM information may be located in different places.How to tell what type of memory your linux pc has installed
    • If we are talking about modern BIOS, that is, about UEFI, you need to look for RAM information on the main screen. The Total Memory column indicates the frequency, type and amount of RAM installed in your computer.How to tell what type of memory your linux pc has installed

    Advantages of obtaining RAM information by BIOS means:

    • You can receive data even if Windows is not installed on your computer or is not loaded;
    • If you need to check several memory sticks in a row, this method is the fastest.

    Disadvantages of obtaining RAM information by BIOS means:

    • Since there are many BIOS versions, and most often they are not localized, it can be difficult to find information about RAM among the huge amount of parameters;
    • The old BIOS do not always display all the necessary information, and often it shows only the amount of RAM.

    WINDOWS MEANS

    Windows operating system has built-in utilities that allow you to find the minimal information about RAM – its capacity. This means that it is impossible to determine the type of memory and the frequency with the operating system utilities.

    There is another important limitation. Windows will only show the amount of memory used, not the total size of the installed one. Attention should be paid to this aspect if your computer has 32-bit Windows, which does not support more than 3 GB of RAM. That is, if more RAM is installed in your computer, it will not be displayed in diagnostic utilities, and “extra” memory will not be used during operation.

    There are several ways to determine the amount of RAM by Windows means. Here is the easiest one:

    • Right-click on the “My Computer” icon in the explorer and select “Properties”. There will open a window where the amount of installed RAM will be indicated;

    How to tell what type of memory your linux pc has installed

    • Press the keyboard shortcut Windows + R and enter the msinfo32 command, then press Enter. You will see the “System Information” window, where RAM information is stored in the main tab.

    How to tell what type of memory your linux pc has installed

    THIRD PARTY APPLICATIONS

    There are lots of diagnostic applications released for Windows, each one of them can be used to solve some certain problems. Most of them provide the opportunity to learn information about RAM. Below we will give you examples of programs that can be downloaded for free from their developer’s websites and they can help you find information about your RAM.

    Information about RAM in the CPU-Z application is spread over several tabs:

    • In the “General” column, the “Type” value will tell you about the type of installed RAM, and in the “Size” section you will find information on the amount of RAM. Also below in the “Timing” column you should be able to find information about the operating frequency.
    • In the SPD tab, you can determine the number of installed memory sticks and detailed information about each one of them.

    How to tell what type of memory your linux pc has installed

    AIDA64

    Another convenient application for viewing information about the components installed in a computer is AIDA64. In order to learn information about RAM through this program, select the SPD item in the “Motherboard” tab. The application defines all main RAM parameters.

    How to tell what type of memory your linux pc has installed

    HWINFO64-32

    HWiNFO64-32 is another handy application that allows you to diagnose the system and check its parameters. Unlike AIDA64, this application has a portable version that does not even need to be installed in your computer. All information about RAM in the HWiNFO64-32 application is displayed in the “Memory” column.

    If you are running Windows you can download an app called System Information for Windows (this link takes you to a site you can download it from).

    SIW audits your computer and gives you detailed information about your computer configuration. Although it has a wide variety of uses, it is great for getting information about your memory.

    Standalone Memory Identifier

    SIW is a standalone app so it can run from anywhere on your computer and even from your USB flash drive . To see your memory information, run SIW and click on “Memory” in the left hand menu.

    SIW is a standalone memory identifier

    Other options to check memory type

    Another way to determine your memory type is to use the Crucial Memory Advisor Tool located at Crucial.com.

    An alternative is the Kingston Memory Search Tool at Kingston.com. These tools allow you to either search by the computer manufacturer or by your motherboard manufacturer.

    They also give you additional information like the maximum amount of memory you computer can use or how many memory slots your motherboard has. Even if you don’t want to purchase the memory from these sites, you can still use these tools as a reference to determine what type you need.

    So there are several options to perform a memory type check. If you know of other ways to check memory type or possibly even an easier way please feel free to share your thoughts.

    Lowell Heddings
    How to tell what type of memory your linux pc has installedLowell Heddings
    Founder and CEO

    Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work. Read more.

    If you are looking to upgrade the memory in your computer, you are probably wondering how many open slots you have, what type of memory is already installed, and what you need to buy for an upgrade… without having to open your computer.

    Since you shouldn’t have to open up the computer just to figure out what you have installed, here’s a couple of options for detecting the type of memory already installed in your system.

    Using Speccy

    This very useful free application should be a standard in any geek’s toolkit. It comes bundled as a single file, no installation required, assuming you download the portable version. They also have a paid version with more features.

    You can immediately see the type of RAM you have installed.

    How to tell what type of memory your linux pc has installed

    The only question is whether I can install faster memory than the memory already installed, which leads us into our next option.

    Using the Crucial Memory Advisor

    Memory manufacturer Crucial has put together an amazing website, combined with an optional system scanner tool that will detect the memory already installed in your computer the same way System Information for Windows does… It’s just not as geeky.

    On their homepage, there’s the two options… if you’ve already figured out the memory you have installed, you can use the drop-down menus on the right to select your system.

    How to tell what type of memory your linux pc has installed

    They will give you some great information about what your computer can support, along with a list of questions and answers. Turns out I can upgrade to faster PC2-5300 memory if I wanted…

    How to tell what type of memory your linux pc has installed

    If you chose the system scanner route, you’ll be redirected to a web page showing you the current memory configuration, and what they recommend for upgrading, although they seem to give you less information on this screen.

    How to tell what type of memory your linux pc has installed

    I’m not sure that you necessarily want to buy memory from Crucial directly since you could probably get a better price elsewhere, but their memory advisor is extremely useful to figure out what you need.

    Other Options

    • You can look up the specs for your system to figure out what memory types your computer takes. I usually google for “modelnumber specs”, for instance I’d type in “nc8430 specs”.
    • You can use some of the other memory advisors, like Kingston or PNY, but their sites are a bit less useful.
    • Pull out the manual for your computer or motherboard, and take a look at your receipts to figure out what you bought last time.
    • If you built a computer with parts from Newegg, you can look at your order history to re-order the exact same memory module if you know you have empty slots. (This is exactly the route I chose last month)
    • If you are running Mac OS X, you can just look under your “About this Mac” and then click on More Info.

    Upgrading the memory in your computer is the fastest way to better performance in Windows Vista. I’d recommend 2GB of RAM for Vista, but don’t bother going over 3GB if you are using 32-bit Vista or XP because Windows won’t be able to use all of it.

    • › How to Add Images to Questions in Google Forms
    • › How to Delete Your Photos on Facebook
    • › Razer Thinks You Want a PC Gaming Headset That Vibrates
    • › How to Get a Link to a Photo or Video on Instagram
    • › The Fix for Slow AMD Processors on Windows 11 Is Here

    How to tell what type of memory your linux pc has installed Lowell Heddings
    Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work.
    Read Full Bio »

    How to tell what type of memory your linux pc has installed

    For a very long time, the most common path to improving your PC’s performance has been through upgrading the RAM. RAM stands for “random access memory” and it’s effectively the component of your PC that is keeping track of what your computer is currently working on. When RAM is limited, your PC has to keep that current information stored somewhere else, which can dramatically slow down your workflow and load times. This is particularly notable in computationally heavy projects, such as video encoding and high-quality art creation.

    Whether you’re looking to upgrade or you’re looking to harvest the RAM from one PC to use in another, it helps to know what kind of RAM your system is using. There are a handful of ways to figure that out!

    In Windows 10

    You can find basic information about your RAM through your system’s About page and through the Performance tab on your Task Manager.

    How to tell what type of memory your linux pc has installed

    Kevin Casper/IDG

    Here are two simple methods to access the About page:

    • Press the key combination Win + Pause/Break
    • Type “About your PC” in the Windows Start menu search

    To access the Task Manager, here are three simple options:

    • Press the key combination Ctrl + Shift + Escape
    • Press the key combination Ctrl + Alt + Delete and select “Task Manager”
    • Type “Task Manager” in the Windows Start menu search

    These two methods will provide you with the most simplistic view of your PC’s RAM information, primarily showing how much RAM you currently have, along with some RAM speed information. If this isn’t enough information for what you’re looking to do, then you may want to check out the Windows Management Instrumentation command-line utility, or wmic.

    Kevin Casper/IDG

    In order to use wmic, you need to open a Command Prompt window, which is quickly done by typing “cmd” into the Windows Start menu search. Once there, you can use a “wmic MemoryChip get” command to typically pull up the information you’re looking for.

    You can find a comprehensive set of properties to include on your “wmic MemoryChip get” command here, but the following should cover the practical bases for most RAM identification needs:

    wmic MemoryChip get MemoryType, Capacity, Speed, Configuredclockspeed, DeviceLocator, FormFactor, Manufacturer, Serialnumber, Partnumber

    This will provide a table with the following information, if it’s available:

    • MemoryType will report back a number that aligns to a particular “type” of RAM module. 20 means it’s DDR memory. DDR2 is 21. DDR3 is 24. DDR4 is 26. Sometimes, this may show a 0. If so, you’ll want to use “SMBIOSMemoryType” instead.
    • Capacity will show the raw byte value of the RAM’s memory capacity, so something like 8,589,934,592 will be for an 8GB RAM module.
    • Speed is the supported memory speed value that your RAM module indicates it can support, which is typically anywhere between 800 and 3200.
    • Configuredclockspeed relates to the speed at which your RAM is currently configured to be running at.
    • DeviceLocator will tell you which physical slot the RAM module is plugged into on your system’s motherboard.
    • FormFactor is the physical shape type of the RAM module. This will typically be the number 8 for DIMM modules found on desktop PCs or the number 12 for laptops’ SODIMM forms.
    • Manufacturer indicates an identified manufacturer of the RAM module. This may show up as Unknown sometimes.
    • Serialnumber will give you the hardware serial number for that specific stick of RAM, which is typically only relevant when dealing with the manufacturer for troubleshooting purposes.
    • Partnumber provides the manufacturer’s model number for that particular RAM module, which can be very useful with the help of a Google search to identify the RAM stick you have and whether or not you can buy it again.

    Additional software options

    Much of the above information is also available with the help of some third-party software, such as CPU-Z and Speccy.

    How to tell what type of memory your linux pc has installed

    Kevin Casper/IDG

    In CPU-Z, you’ll want to use the “Memory” and “SPD” tabs to see information about your RAM. Memory will show you memory type and current frequency information. The SPD tab, which stands for “serial presence detect,” provides information related to the RAM modules themselves including the manufacturer and part number information.

    How to tell what type of memory your linux pc has installed

    Kevin Casper/IDG

    In Speccy, you’ll want to go to the “RAM” view from the left menu. In there, you should find virtually all of the RAM and memory information you’d need. You may need to expand the “SPD” drop-down in order to get more specific information about the RAM depending on what you’re trying to find.

    In Linux

    You can find virtually all of the information shown above via your Linux terminal by using the following command:

    • sudo dmidecode —type memory

    This should provide a sorted list of information about your memory devices, aka your RAM, including size, types, and manufacturer information.

    Physical RAM module

    Most consumer RAM modules will come with a label to identify the type of RAM it is. Typically, these labels will either be a sticker applied directly to the stick of RAM, engraved onto the fancy heat spreader on higher-performance modules, or may be printed directly onto the circuit board. In these cases, you’ll typically find the part number, which you can then look up with your favorite search engine to figure out the rest of the specs. If you can’t locate a label or identifier anywhere, then it may be prudent to use one of the methods described above instead.

    These options should help you figure out what RAM your PC is using. If you’re looking to upgrade, be sure that you’re getting the same type and form factor of RAM, because you can’t directly swap out DDR3 for DDR4 RAM without having to also replace your motherboard. For more information on upgrading RAM, see our guide on How to install new memory in your PC.

    How to tell what type of memory your linux pc has installedChecking physical memory (RAM)

    In this article we will see basic commands to check physical memory on a server in Linux. Many beginners struggle with knowing their system well in context to resources like CPU, Memory, disks, etc. So I decided to write this small article pinpointing commands to check RAM on the Linux server. These commands will work in different flavors of Linux like Red Hat, CentOS, Suse, Ubuntu, Fedora, Debian, etc.

    Without much delay lets dive into commands –

    1. Using free command

    The first command is free. This is the simplest command to check your physical memory. This command is mainly used for checking RAM and SWAP on the system. Using different switch you can change the byte-format of output. Like -b for bytes, -k for kilobytes, -m for megabytes and -g for gigabytes.

    Check row with Mem: and number against it. That’s the physical RAM of your server.

    In the above output you can see the system is installed with 125GB of physical RAM (observe highlighted rows). By using a different switch -b , -k , -m and -g output changed numbers according to selected byte-format.

    2. Using /proc/meminfo file

    Another way is to read memory info from the proc filesystem. /proc/meminfo is the file you should read to get detailed information about memory. The very first line or line starts with MemTotal is your total physical memory on the server.

    As you can see from output, memory is displayed in kilobytes.

    3. Using top command

    The famous top command also lists physical memory information in a very clear way. In the upper section of the top command output lies the CPU, Memory, and SWAP information.

    I clipped the above section of the top command output in the above example. Check second last line saying Mem: (highlighted row). This shows physical memory in kilobytes. You can see the total, used, and free portions of it. Total is your actual RAM installed on the server.

    4. Using vmstat

    Another way is to use vmstat (virtual memory stats) command with -s switch. This will list memory in detail with the first-line being total memory on the server.

    Memory is displayed in kilobytes by default. The very first line shows you total memory on the server.

    How to tell what type of memory your linux pc has installed

    Open the Device Manager and expand the "Universal Serial Bus Controllers" section. In the list of USB ports, you can tell which version of USB your computer by looking at the port name, based on the following guidelines.

    • USB 3.0 – USB port name will include "USB 3.0" within it
    • USB 2.0 – USB port name will include "Enhanced" or "Enhanced Host" within it (may also include "Universal Host" in the name)
    • USB 1.1 – USB port name will include "Universal Host" within it (will not include "Enhanced" in the name)

    USB 2.0 was introduced in 2001. If your computer was built before 2001, it is likely that it has USB 1.1 or 1.0 ports.

    Labels on USB ports or devices

    Many devices and computers using USB 2.0 or USB 3.0 will indicate if products are USB 2.0 or USB 3.0 ready. In the case of USB 2.0, they may also indicate they are Hi-Speed. Computers and devices that have this Hi-Speed designation are USB 2.0 compatible. USB 3.0 ports and devices should be labeled as such, if labeled at all.

    Product documentation

    If you’ve tried the recommendations above and are still unable to determine which version of USB your computer has, refer to the hardware documentation.

    How to tell what type of memory your linux pc has installedKevin Stanchfield (CC BY 2.0)

    There are numerous ways to get information on the memory installed on Linux systems and view how much of that memory is being used. Some commands provide an overwhelming amount of detail, while others provide succinct, though not necessarily easy-to-digest, answers. In this post, we’ll look at some of the more useful tools for checking on memory and its usage.

    Before we get into the details, however, let’s review a few basics. Physical memory and virtual memory are not the same. The latter includes disk space configured to be used as swap. Swap may include partitions set aside for this usage or files that are created to add to the available swap space when creating a new partition may not be practical. Some Linux commands provide information on both.

    Swap expands memory by providing disk space that can be used to house inactive pages that are moved to disk when physical memory fills up.

    One file that plays a role in memory management is /proc/kcore. This file looks like a normal (though extremely large) file, but it does not occupy disk space at all. Instead, it is a virtual file like all of the files in /proc.

    Interestingly, the two systems queried below do not have the same amount of memory installed, yet the size of /proc/kcore is the same on both. The first of these two systems has 4 GB of memory installed; the second has 6 GB.

    Explanations that claim the size of this file represents the amount of available virtual memory (maybe plus 4K) don’t hold much weight. This number would suggest that the virtual memory on these systems is 128 terabytes! That number seems to represent instead how much memory a 64-bit systems might be capable of addressing — not how much is available on the system. Calculations of what 128 terabytes and that number, plus 4K would look like are fairly easy to make on the command line:

    Another and more human-friendly command for examining memory is the free command. It gives you an easy-to-understand report on memory.

    With the -g option, free reports the values in gigabytes.

    With the -t option, free shows the same values as it does with no options (don’t confuse -t with terabytes!) but by adding a total line at the bottom of its output.

    And, of course, you can choose to use both options.

    You might be disappointed in this report if you’re trying to answer the question “How much RAM is installed on this system?” This is the same system shown in the example above that was described as having 6GB of RAM. That doesn’t mean this report is wrong, but that it’s the system’s view of the memory it has at its disposal.

    The free command also provides an option to update the display every X seconds (10 in the example below).

    With -l, the free command provides high and low memory usage.

    Another option for looking at memory is the /proc/meminfo file. Like /proc/kcore, this is a virtual file and one that gives a useful report showing how much memory is installed, free and available. Clearly, free and available do not represent the same thing. MemFree seems to represent unused RAM. MemAvailable is an estimate of how much memory is available for starting new applications.

    If you only want to see total memory, you can use one of these commands:

    The DirectMap entries break information on memory into categories.

    DirectMap4k represents the amount of memory being mapped to standard 4k pages, while DirectMap2M shows the amount of memory being mapped to 2MB pages.

    The getconf command is one that will provide quite a bit more information than most of us want to contemplate.

    Pare that output down to something specific with a command like the one shown below, and you’ll get the same kind of information provided by some of the commands above.

    That command calculates memory by multiplying the values in the first and last lines of output like this:

    Calculating that independently, we can see how that value is derived.

    Clearly that’s one of those commands that deserves to be turned into an alias!

    Another command with very digestible output is top. In the first five lines of top’s output, you’ll see some numbers that show how memory is being used.

    And finally a command that will answer the question “So, how much RAM is installed on this system?” in a succinct fashion:

    Depending on how much detail you want to see, Linux systems provide a lot of options for seeing how much memory is installed on your systems and how much is used and available.

    Sandra Henry-Stocker has been administering Unix systems for more than 30 years. She describes herself as “USL” (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she’s chasing the bears away from her bird feeders.