2

I have 16GB RAM on my Mac. Instead of physically removing it, is there a software setting where I can make it think it only has 8GB RAM?

I would like to understand performance of my application with less RAM.

1
  • 2
    You could just allocate part of the memory for something else, a ramdisk perhaps. Then fill that up until you only have a certain amount of left that you want to use for testing whatever software it is you want to test. Commented Sep 23, 2015 at 19:13

2 Answers 2

7

You can set the maxmem boot argument to the desired memory limit in MebiBytes, and then reboot.

First, see what boot arguments you already have:

nvram boot-args

Then, assuming you don't have any (this is probably the default), just add the maxmem boot-arg. Here's how to set it for 8GiB:

sudo nvram boot-args="maxmem=8192"

…then reboot.

You can delete the boot-args boot-time environment variable later like this:

sudo nvram -d boot-args
4
  • don't you need nvram -p to read existing params? I get an error on nvram boot -args ... nvram: Error getting variable - 'boot': (iokit/common) data was not found
    – Tetsujin
    Commented Sep 23, 2015 at 19:23
  • @Tetsujin No, you don't need -p to read existing variables. You do need to correctly type the name of the variable you want to read, which in this case is boot-args, not boot or -args. The message you saw was what you get when the variable you asked for does not exist.
    – Spiff
    Commented Sep 23, 2015 at 19:30
  • I'm copy/pasting the first [code] line of your answer - it no werky ;) Actually same response with or without the space [10.10.5 if that's relevant]
    – Tetsujin
    Commented Sep 23, 2015 at 19:42
  • Might like to add that for Apple silicon Macs, you must first disable SIP. Otherwise boot-args is ignored. Apart from that, this 9 year old answer is still valid!
    – Gilby
    Commented Apr 30 at 5:28
-1

Create a virtual machine for testing, using VMware Fusion, Parallels, or VirtualBox. This would allow you to change the amount of memory, number of CPUs, network settings, video settings, software dependencies, operating systems, etc. You can change machine settings and reboot the virtual machine, without making any changes to your host computer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .