Ernst
Posts: 1179
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

How can the memory size on Pi4B be reduced ?

Thu Jun 27, 2019 9:01 am

I have been searching and I have not been able to find an answer.

What I would like to know if it possible to reduce the memory size on a Pi4B/4GB to be able to evaluate running applications on a device with 1GB or 2GB memory.

I tried to add "mem=512M" to cmdline on a Pi3B but the boot failed after this change.
The road to insanity is paved with static ip addresses

User avatar
procount
Posts: 1660
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: How can the memory size on Pi4B be reduced ?

Thu Jun 27, 2019 9:09 am

NOOBS/PINN use recovery.elf, which is a copy of start_cd.elf.
This file restricts the base memory to 256MB. I assume it's use in NOOBS is to ensure it works properly on all model variants (?).
So yes, it can be done via the start.elf file, but that's closed source and probably not an option for normal users to specify the memory size.

Another thought which might be more practical for you is to create a ramdisk in tmpfs of 2GB/3GB in size to restrict the available RAM that is available.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

SkyRise
Posts: 173
Joined: Tue Jan 24, 2012 1:20 pm

Re: How can the memory size on Pi4B be reduced ?

Thu Jun 27, 2019 9:12 am

Or assign the extra memory to the GPU (assuming there isn't a limit here).
It then won't be available to the CPU and Linux (unless your application uses the GPU obviously...)

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6995
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How can the memory size on Pi4B be reduced ?

Thu Jun 27, 2019 10:00 am

Add "total_mem=1024" or similar to /boot/config.txt.
(docs need updating to add that one).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Ernst
Posts: 1179
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: How can the memory size on Pi4B be reduced ?

Thu Jun 27, 2019 10:28 am

6by9 wrote:
Thu Jun 27, 2019 10:00 am
Add "total_mem=1024" or similar to /boot/config.txt.
(docs need updating to add that one).
Thank you for this information, I just confirmed that it works using a Pi3B with Buster.
The road to insanity is paved with static ip addresses

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

Re: How can the memory size on Pi4B be reduced ?

Fri Jun 28, 2019 1:06 am

Ernst wrote:
Thu Jun 27, 2019 10:28 am
6by9 wrote:
Thu Jun 27, 2019 10:00 am
Add "total_mem=1024" or similar to /boot/config.txt.
(docs need updating to add that one).
Thank you for this information, I just confirmed that it works using a Pi3B with Buster.
A Pi3b only has 1GB of RAM anyway..
55:55:44:44:4C
52:4C:52:42:41

Ernst
Posts: 1179
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: How can the memory size on Pi4B be reduced ?

Fri Jun 28, 2019 6:01 am

Imperf3kt wrote:
Fri Jun 28, 2019 1:06 am
Ernst wrote:
Thu Jun 27, 2019 10:28 am
6by9 wrote:
Thu Jun 27, 2019 10:00 am
Add "total_mem=1024" or similar to /boot/config.txt.
(docs need updating to add that one).
Thank you for this information, I just confirmed that it works using a Pi3B with Buster.
A Pi3b only has 1GB of RAM anyway..
What can you do when the only thing you have is a Pi3B with a Pi4B/4GB in the mail ?
You can use a Pi3B and use the option to reduce the memory to 512.
This was a question about buster, not about the Pi4B, although intended for use with the Pi4B.
The road to insanity is paved with static ip addresses

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

Re: How can the memory size on Pi4B be reduced ?

Fri Jun 28, 2019 10:12 am

Ah, didn't realise you wanted to reduce the memory to 512mb. Thought you wanted to reduce 1GB to 1GB
55:55:44:44:4C
52:4C:52:42:41

Return to “Advanced users”