hitsware
Posts: 136
Joined: Sat Mar 26, 2016 10:12 pm
Location: sacramento , california , usa
Contact: Website

RPi 4 power consumption vs. RAM

Sun Oct 20, 2019 1:53 am

Does additional RAM make for significant additional current draw ?
Additional heat ?

What performance enhancement does more RAM provide ?

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

Re: RPi 4 power consumption vs. RAM

Sun Oct 20, 2019 3:16 am

The static power will increase (that needed to keep the memory refreshed) but the power needed for accessing the memory (reading & writing) will largely be the same as the bandwidth doesn't change. I'd think the power usage of the rest of the system would make power consumption fairly negligible between having 1GB and 4GB (not that I have any experience in the field so I may be wrong).

As for performance gains, Linux will be able to keep more data in the file caches to reduce disk access times, less likely to run into needing swap space when running memory hungry programs (like browsers with lots of tabs open or big compiling jobs). Pretty much the gains you have in any computer by having more available memory.
Last edited by Paeryn on Sun Oct 20, 2019 3:27 am, edited 1 time in total.
She who travels light — forgot something.

hitsware
Posts: 136
Joined: Sat Mar 26, 2016 10:12 pm
Location: sacramento , california , usa
Contact: Website

Re: RPi 4 power consumption vs. RAM

Sun Oct 20, 2019 3:23 am

Is the RAM on the main (SOIC ?) chip ?

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

Re: RPi 4 power consumption vs. RAM

Sun Oct 20, 2019 3:33 am

hitsware wrote:
Sun Oct 20, 2019 3:23 am
Is the RAM on the main (SOIC ?) chip ?
No, the RAM is on a separate chip. The RPi0 and RPi1 have the RAM chip sat directly on top of the SoC (so it looks like one chip unless you look closely) but for all other RPis they are on different parts of the PCB. The SoC does have some cache memory on-chip for the CPUs but that is nothing to do with the amount of RAM.
She who travels light — forgot something.

hitsware
Posts: 136
Joined: Sat Mar 26, 2016 10:12 pm
Location: sacramento , california , usa
Contact: Website

Re: RPi 4 power consumption vs. RAM

Sun Oct 20, 2019 5:52 pm

So RPi w/8G RAM is not more apt to thermally ' throttle down ' than w/1G ?

How does more RAM help performance ?

jahboater
Posts: 4766
Joined: Wed Feb 04, 2015 6:38 pm

Re: RPi 4 power consumption vs. RAM

Sun Oct 20, 2019 6:02 pm

The maximum memory size is 4GB.
hitsware wrote:
Sun Oct 20, 2019 5:52 pm
How does more RAM help performance ?
Please read Paeryn's post again.

User avatar
rpdom
Posts: 15393
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: RPi 4 power consumption vs. RAM

Sun Oct 20, 2019 6:05 pm

hitsware wrote:
Sun Oct 20, 2019 5:52 pm
How does more RAM help performance ?
It depends what you are running. Some software needs (wants) more memory than others. If you haven't got enough RAM available it will use virtual memory (swap space on the SD card) instead and run really slowly.

jahboater
Posts: 4766
Joined: Wed Feb 04, 2015 6:38 pm

Re: RPi 4 power consumption vs. RAM

Sun Oct 20, 2019 7:17 pm

rpdom wrote:
Sun Oct 20, 2019 6:05 pm
hitsware wrote:
Sun Oct 20, 2019 5:52 pm
How does more RAM help performance ?
It depends what you are running. Some software needs (wants) more memory than others. If you haven't got enough RAM available it will use virtual memory (swap space on the SD card) instead and run really slowly.
Also if you are running multiple things at the same time, then obviously more memory is needed.

Heater
Posts: 13620
Joined: Tue Jul 17, 2012 3:02 pm

Re: RPi 4 power consumption vs. RAM

Sun Oct 20, 2019 7:39 pm

The key here is that if you run out of memory you don't just crash and die. The Linux kernel will rather start swapping what you have in RAM in and out of disk storage. Which is thousands of times slower than running from RAM directly.

This is more likely to happen if you are running a lot of big programs at the same time, but it can also happen if you are running a single program that needs more memory space than you have RAM space.

The end result for the user is that the machine is often much faster with more RAM as there is less swapping or RAM content to disk and back again.
Memory in C++ is a leaky abstraction .

hitsware
Posts: 136
Joined: Sat Mar 26, 2016 10:12 pm
Location: sacramento , california , usa
Contact: Website

Re: RPi 4 power consumption vs. RAM

Mon Oct 21, 2019 10:29 pm

Thank You Every One ! :D

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

Re: RPi 4 power consumption vs. RAM

Mon Oct 21, 2019 11:01 pm

hitsware wrote:
Sun Oct 20, 2019 5:52 pm
So RPi w/8G RAM is not more apt to thermally ' throttle down ' than w/1G ?
There isn't an 8GB Pi. The largest Pi, so far, has 4GB.

This is not to say that there *couldn't* be an 8GB Pi4B, just that there isn't one on the market.

User avatar
rin67630
Posts: 568
Joined: Fri Mar 04, 2016 10:15 am

Re: RPi 4 power consumption vs. RAM

Tue Oct 22, 2019 10:21 am

hitsware wrote:
Sun Oct 20, 2019 1:53 am
What performance enhancement does more RAM provide ?
Frequently for systems running unattended just nothing...

jahboater
Posts: 4766
Joined: Wed Feb 04, 2015 6:38 pm

Re: RPi 4 power consumption vs. RAM

Tue Oct 22, 2019 7:17 pm

rin67630 wrote:
Tue Oct 22, 2019 10:21 am
hitsware wrote:
Sun Oct 20, 2019 1:53 am
What performance enhancement does more RAM provide ?
Frequently for systems running unattended just nothing...
Unused memory gets used for disk cache.

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

Re: RPi 4 power consumption vs. RAM

Tue Oct 22, 2019 8:50 pm

jahboater wrote:
Tue Oct 22, 2019 7:17 pm
rin67630 wrote:
Tue Oct 22, 2019 10:21 am
hitsware wrote:
Sun Oct 20, 2019 1:53 am
What performance enhancement does more RAM provide ?
Frequently for systems running unattended just nothing...
Unused memory gets used for disk cache.
Well...maybe. Given that the system issues a sync command periodically, those disk caches will get cleared. Plus, not all programs write very much, so not much caching may be needed.

jahboater
Posts: 4766
Joined: Wed Feb 04, 2015 6:38 pm

Re: RPi 4 power consumption vs. RAM

Tue Oct 22, 2019 10:46 pm

W. H. Heydt wrote:
Tue Oct 22, 2019 8:50 pm
jahboater wrote:
Tue Oct 22, 2019 7:17 pm
rin67630 wrote:
Tue Oct 22, 2019 10:21 am


Frequently for systems running unattended just nothing...
Unused memory gets used for disk cache.
Well...maybe. Given that the system issues a sync command periodically, those disk caches will get cleared.
The dirty pages get flushed. Others remain.
W. H. Heydt wrote:
Tue Oct 22, 2019 8:50 pm
Plus, not all programs write very much, so not much caching may be needed.
Disk reads are cached as well of course (read a file or run a large program for the first time, and its slow because it must be read from the disk. Read the same file, or run the same program some time later, and it will be fast because its come from the cache).

Executable and read-only pages are retained in the cache so that multiple programs can share them. (run multiple instances of the same program, or multiple programs using the same library, and the total memory required is much less than you would expect because the immutable pages are shared).

When your program reads a disk block, following disk blocks are read (prefetched) into the cache automatically and asynchronously so that they are available quickly if needed.

Many filesystems now on Linux are tmpfs which is virtual memory.

Code: Select all

[email protected]:~ $ df
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        59G  9.9G   47G  18% /
devtmpfs        1.8G     0  1.8G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  8.5M  1.9G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           1.9G  768K  1.9G   1% /tmp
tmpfs            16M  600K   16M   4% /var/log
/dev/mmcblk0p1  253M   53M  200M  21% /boot
tmpfs           386M     0  386M   0% /run/user/1000
[email protected]:~ $ 
Lots of things happen in a modern OS's cache/memory!

hitsware
Posts: 136
Joined: Sat Mar 26, 2016 10:12 pm
Location: sacramento , california , usa
Contact: Website

Re: RPi 4 power consumption vs. RAM

Wed Oct 23, 2019 3:34 am

The plot thickens :D

Return to “General discussion”