How to limit RAM in an OSX device? Related to my other question, I'm about to buy a new Mac Mini. I would like to reduce RAM to 8GB in order to see if 8GB is enough to my daily tasks in my MBP retina 15 early 2013 16GB RAM.

The idea is I’ll let this mac not make use of any more RAM than 8 GB for the running applications to see if they swap to disk or run well with 8 GB of RAM.

Can I do this sort of artificial restriction on a mac that has RAM soldered or when it’s inconvenient to go physically remove RAM for testing purposes?
Create a ram disk :-)
From the answer to Mount a RAM disk on boot:

You can create and mount a RAM disk with the following Terminal (i.e. shell) command:
diskutil erasevolume HFS+ &quot;diskName&quot; $(hdiutil attach -nomount ram://2048)

Where 2048 can be any number and represents the number of 512 byte blocks you want to allocate. So 1,000,000 will get you 512,000,000 bytes. (Of course, you have to leave out the commas.)

So in your case the command would be
diskutil erasevolume HFS+ &quot;diskName&quot; $(hdiutil attach -nomount ram://$((8*2**30/512)))