dcaccount
Posts: 195
Joined: Sun Jan 15, 2017 11:56 am

How to check Rpi4 memory available

Sat Nov 30, 2019 9:18 pm

Hello,
I have just bought a Rpi4 and unfortunately I did not check the memory chip before attaching the heat sink.

How can I check the total available memory from the GUI or from the command line?

Thanks!
Dan

trejan
Posts: 2969
Joined: Tue Jul 02, 2019 2:28 pm

Re: How to check Rpi4 memory available

Sat Nov 30, 2019 9:21 pm

Run "cat /proc/cpuinfo" and look up the revision code on https://www.raspberrypi.org/documentati ... /README.md

If you want to see available memory counted in MB then run "free -m". The missing portion is used by the GPU.
Last edited by trejan on Sat Nov 30, 2019 9:21 pm, edited 1 time in total.

wildfire
Posts: 667
Joined: Sat Sep 03, 2016 10:39 am
Location: Dundee, Scotland

Re: How to check Rpi4 memory available

Sat Nov 30, 2019 9:21 pm

From command line type free.

ETA: Trejan's response is more accurate though my response is easier and will give you a good idea of how much memory is installed.
E8 85 A2 40 C9 40 81 94 40 81 95 40 89 84 89 96 A3
Still NF Shirls

W. H. Heydt
Posts: 13612
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: How to check Rpi4 memory available

Sat Nov 30, 2019 11:00 pm

Or you could look at the box it came in.

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: How to check Rpi4 memory available

Sun Dec 01, 2019 12:13 am

And " free -h " will give the answer in Gigs and Megs.
pi@raspberrypi:~ $ free -m
total used free shared buff/cache available
Mem: 3627 655 2050 172 922 2725
Swap: 2047 0 2047
pi@raspberrypi:~ $ free -h
total used free shared buff/cache available
Mem: 3.5Gi 654Mi 2.0Gi 170Mi 921Mi 2.7Gi
Swap: 2.0Gi 0B 2.0Gi
pi@raspberrypi:~ $
Remember, nobody is listening to you
until you fart ...

W. H. Heydt
Posts: 13612
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: How to check Rpi4 memory available

Sun Dec 01, 2019 12:27 am

RossDv8 wrote:
Sun Dec 01, 2019 12:13 am
And " free -h " will give the answer in Gigs and Megs.

Code: Select all

[quote]pi@raspberrypi:~ $ free -m
              total        used        free      shared  buff/cache   available
Mem:           3627         655        2050         172         922        2725
Swap:          2047           0        2047
pi@raspberrypi:~ $ free -h
              total        used        free      shared  buff/cache   available
Mem:          3.5Gi       654Mi       2.0Gi       170Mi       921Mi       2.7Gi
Swap:         2.0Gi          0B       2.0Gi
pi@raspberrypi:~ $ 
FTFY.

User avatar
Imperf3kt
Posts: 4018
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: How to check Rpi4 memory available

Sun Dec 01, 2019 3:09 am

Typing "top" into a terminal will also tell you how much ram there is, how much is in use and how much is available
55:55:44:44:4C
52:4C:52:42:41

Rose coloured glasses are difficult to see through.

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: How to check Rpi4 memory available

Sun Dec 01, 2019 3:57 am

Typing "top" into a terminal will also tell you how much ram there is, how much is in use and how much is available
And although it looks a bit scary compared to 'free' it is the first 5 lines that are most useful at a quick glance.
Below those lines it is great for checking individual program memory usage.

Also, unlike the others, top is updating in real time.

E D I T

I forgot to add that just as " free - h " gives a more human friendly output than " free -m "

If you type " htop " into a terminal instead of " top " you will get a much easier to read output including colour coding the lines so you can see what is going on more easily.

Not everything about the Linux Command Line is as scary as it looks for beginners :D

top
top1a.jpg
top1a.jpg (133.19 KiB) Viewed 8372 times
htop
top2a.jpg
top2a.jpg (137.97 KiB) Viewed 8372 times
Remember, nobody is listening to you
until you fart ...

dcaccount
Posts: 195
Joined: Sun Jan 15, 2017 11:56 am

Re: How to check Rpi4 memory available

Sun Dec 01, 2019 7:02 am

Thanks!

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: How to check Rpi4 memory available

Sun Dec 01, 2019 7:53 am

I suppose I should have explained that htop is a bit more interactive than it looks.
It is similar to the System Monitor GUI program you find on all Linix distros.
If you clisk on any of the GREEN headings, it will sort on that heading. So click CPU% once and it will sort from lowest to highest, and click again and the highest CPU hogs are at teh top.

Same goes for PID USER MEM% and all the others.
Similarly, in the BLUE at the bottom,
Setup lets you change settings in htop
Search lets you find a particular program or process
Filter lets you focus on all the processes being used by a particular program (Filter on Chromium if you have it running)
Esc takes you OUT of any of those Blue items
Which is Very Handy if you accidentally clicked on Kill !!! Which can create HAVOC if you don't know what you are doing.

Googling htop is interesting.

I start htop with one click on an icon on a Panel ( just too lazy to open a Terminal to type the 4 letters) because I prefer it to other montors.
Remember, nobody is listening to you
until you fart ...

User avatar
jahboater
Posts: 6287
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: How to check Rpi4 memory available

Sun Dec 01, 2019 7:56 am

Also try:

Code: Select all

cat /proc/meminfo

User avatar
diogen151
Posts: 67
Joined: Mon Apr 04, 2016 8:32 am
Location: Agram

Re: How to check Rpi4 memory available

Sun Dec 01, 2019 9:21 am

Code: Select all

pi@raspberrypi:~ $ inxi -m | grep total
  RAM: total: 3.89 GiB used: 443.6 MiB (11.1%) gpu: 124.0 MiB
If inxi is not installed:

Code: Select all

pi@raspberrypi:~ $ sudo apt-get install inxi
I use 128 MB for RAMdisk (good for speedup some tasks):

Code: Select all

pi@raspberrypi:~ $ df -m | grep ramdisk
tmpfs                                 128       6      123    5% /mnt/ramdisk
Šalica malina.

User avatar
Wobbo
Posts: 6
Joined: Sun Jan 19, 2020 10:52 am

Re: How to check Rpi4 memory available

Fri Jul 10, 2020 10:31 am

I bought an 8GB but at

Code: Select all

free -m    // Mem  3727
free -h    // Mem  3.6Gi  
htop       // Mem  3.64G
What does this mean? Did I get the wrong one?

User avatar
hansotten
Posts: 358
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: How to check Rpi4 memory available

Fri Jul 10, 2020 10:34 am

Because you run a 32 bit OS perhaps?
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

thatchunkylad198966
Posts: 387
Joined: Thu Jul 04, 2019 10:21 am
Location: UK, Birmingham

Re: How to check Rpi4 memory available

Fri Jul 10, 2020 10:36 am

Wobbo wrote:
Fri Jul 10, 2020 10:31 am
I bought an 8GB but at

Code: Select all

free -m    // Mem  3727
free -h    // Mem  3.6Gi  
htop       // Mem  3.64G
What does this mean? Did I get the wrong one?
Flash the 64bit OS; try again.
One man's trash is another man's treasure! :) Pi's I have; Pi Zero, Pi Zero W, Pi 2 x2, Pi 3 x2, Pi 4 4GB x2.

User avatar
Paeryn
Posts: 3084
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: How to check Rpi4 memory available

Fri Jul 10, 2020 2:42 pm

hansotten wrote:
Fri Jul 10, 2020 10:34 am
Because you run a 32 bit OS perhaps?
The 32-bit RPiOS should still see there is 8GB, the limitation is that only 4GB can be addressed by a process (3GB user accessible when you take in to account that the upper 1GB of the address space is reserved for the kernel). I haven't an 8GB to check if free really can't report more than 4GB.

There is a difference in the power circuitry (between the USB-C port and the HDMI port), can't find an image on here of it but there is one about halfway down this article with the difference highlighted. RPi4-8GB
She who travels light — forgot something.
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!

User avatar
Hackswell
Posts: 22
Joined: Thu May 28, 2020 11:33 pm

Re: How to check Rpi4 memory available

Fri Jul 10, 2020 6:05 pm

Paeryn wrote:
Fri Jul 10, 2020 2:42 pm
hansotten wrote:
Fri Jul 10, 2020 10:34 am
Because you run a 32 bit OS perhaps?
The 32-bit RPiOS should still see there is 8GB, the limitation is that only 4GB can be addressed by a process (3GB user accessible when you take in to account that the upper 1GB of the address space is reserved for the kernel). I haven't an 8GB to check if free really can't report more than 4GB.
It could also be correct. Linux OS will naturally eat tons of RAM for buffers/cache. It will release these as real programs need the space. This is normal and expected.

User avatar
B.Goode
Posts: 10725
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: How to check Rpi4 memory available

Fri Jul 10, 2020 6:15 pm

Hackswell wrote:
Fri Jul 10, 2020 6:05 pm
Paeryn wrote:
Fri Jul 10, 2020 2:42 pm
hansotten wrote:
Fri Jul 10, 2020 10:34 am
Because you run a 32 bit OS perhaps?
The 32-bit RPiOS should still see there is 8GB, the limitation is that only 4GB can be addressed by a process (3GB user accessible when you take in to account that the upper 1GB of the address space is reserved for the kernel). I haven't an 8GB to check if free really can't report more than 4GB.
It could also be correct. Linux OS will naturally eat tons of RAM for buffers/cache. It will release these as real programs need the space. This is normal and expected.




I thought the question was about which model of RPi4 [ 1 | 2 | 4 | 8 ] the hardware was? Surely independent of what OS is running, if any...
dcaccount wrote:
Sat Nov 30, 2019 9:18 pm
Hello,
I have just bought a Rpi4 and unfortunately I did not check the memory chip before attaching the heat sink.

User avatar
jahboater
Posts: 6287
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: How to check Rpi4 memory available

Fri Jul 10, 2020 7:14 pm

Wobbo wrote:
Fri Jul 10, 2020 10:31 am
I bought an 8GB but at

Code: Select all

free -m    // Mem  3727
free -h    // Mem  3.6Gi  
htop       // Mem  3.64G
What does this mean? Did I get the wrong one?
It should look like this:

Code: Select all

pi@raspberrypi:~ $ free -m
              total        used        free      shared  buff/cache   available
Mem:           7866          50        7643          13         172        7696
Swap:             0           0           0
pi@raspberrypi:~ $ free -h
              total        used        free      shared  buff/cache   available
Mem:          7.7Gi        50Mi       7.5Gi        13Mi       172Mi       7.5Gi
Swap:            0B          0B          0B
pi@raspberrypi:~ $ cat /proc/meminfo
MemTotal:        8054900 kB
MemFree:         7826532 kB
MemAvailable:    7881032 kB
Buffers:           15500 kB
Cached:           145536 kB
SwapCached:            0 kB
Active:           138400 kB
Inactive:          40736 kB
Active(anon):      20776 kB
Inactive(anon):    11136 kB
Active(file):     117624 kB
Inactive(file):    29600 kB
Unevictable:          16 kB
Mlocked:              16 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         18176 kB
Mapped:            20536 kB
Shmem:             13816 kB
KReclaimable:      15472 kB
Slab:              30544 kB
SReclaimable:      15472 kB
SUnreclaim:        15072 kB
KernelStack:        1616 kB
PageTables:          832 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     4027448 kB
Committed_AS:      94204 kB
VmallocTotal:   262930368 kB
VmallocUsed:        4312 kB
VmallocChunk:          0 kB
Percpu:              640 kB
CmaTotal:          65536 kB
CmaFree:           64244 kB
pi@raspberrypi:~ $ 
Pi4 8GB running PIOS64 Lite

bjtheone
Posts: 955
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: How to check Rpi4 memory available

Sat Jul 11, 2020 1:21 am

4B 8GB running RPiOS32:

Code: Select all

bj@devnull:~ $ free -m
              total        used        free      shared  buff/cache   available
Mem:           7724        2781        3224         382        1718        4294
Swap:          2047           0        2047

bj@devnull:~ $ free -h
              total        used        free      shared  buff/cache   available
Mem:          7.5Gi       2.8Gi       3.0Gi       419Mi       1.7Gi       4.0Gi
Swap:         2.0Gi          0B       2.0Gi

htop shows 7.54G for Mem
It has nothing to do with 64 bit OS.... As stated the only memory oddness with 32 bit OS is the limitation of 3Gb / process.

trasper
Posts: 1
Joined: Mon Nov 09, 2020 9:49 pm

Re: How to check Rpi4 memory available

Mon Nov 09, 2020 9:59 pm

Hi guys.

The thing with a 32 bit OS is that it can only address 32bit of memory.
8 bit is 256
16 is 65536
24 is 16777216
32 is 4294967296 or 4096MB if you divide by (1024*1024).

So that is basically why you need a 64bit OS to address more memory than 4GB which can address a lot more memory, more than any normal person would fit into a machine. :-)
[ 256^8 ]

So even if you have this fine 64 bit CPU a 32bit OS will limit the memory you can address.

User avatar
jahboater
Posts: 6287
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: How to check Rpi4 memory available

Mon Nov 09, 2020 11:01 pm

trasper wrote:
Mon Nov 09, 2020 9:59 pm
a 32bit OS will limit the memory you can address.
A 32-bit OS can use all of the 8GB physical address space of the Pi4.

Please google LPAE
Pi4 8GB running PIOS64 Lite

Return to “Beginners”