Our application deals with large files, say 2Gb, and accepted wisdom is users need RAM 10X dataset size. Developers have well-specced machines but some users see horrible performance which we attribute to their much lower RAM, but can't categorically prove or measure.

Is there a way on Windows, Linux, Mac to 'hide' RAM from the OS without turning it off. Ideally at run-time i.e. not BIOS? Or even a utility which will gobble a requested amount of RAM and prevent other apps using it?

Our application also makes heavy GPU demands via OpenGL which makes VMs a tricky option. I know that Parallels and VirtualBox simply don't support the OpenGL version we use, others might but are sometimes pricey.

  • 3
    How about a VM? Only other way I can think of is to physically remove the RAM. Low RAM + old spinning rust HD will be even worse than SSD. – Tetsujin Sep 19 '18 at 17:49
  • @Tetsujin thanks for reminding me to add a note on that to my question... I'd forgotten – Mr. Boy Sep 19 '18 at 18:23
  • It's worthwhile keeping several generations of old PCs for QA purposes for exactly this reason. And it's cheap to get them if you don't have them already. Make sure you clean-format them before testing. – Christopher Hostage Sep 19 '18 at 20:19

There is.

On Linux, use the kernel command line parameter mem=. Add this option to the kernel command line in GRUB. Reference.

Windows has the /BURNMEMORY and /TRUNCATEMEMORY boot switches. Use bcdedit to add these switches or Reference. On Windows Vista and 7, F10 gets you into a pre-boot screen where you could add it for just that session, not sure how that works with Windows 10. Use BCDEdit option if not available. Another reference.

| improve this answer | |

Deduct some available memory by creating a ramdrive, which will not impose the additional CPU cycle burden of a VM.

Ramdrives, or ramdisks, are discussed herein for Windows, Linux, and MacOS.

For Windows, one Open Source app is ImDisk, but there are many other choices.

Linux includes tmpfs but you have multiple other options here as well, such as the use of mem as a command-line option in the kernel, as noted in comments below by Austin Hemmelgarn.

For MacOS, you don't even need to create the ramdisk to obligate the memory; instead, as per the aforementioned link, do

hdiutil attach -nomount ram://1165430 /dev/disk4
| improve this answer | |
  • tmpfs isn't a package, and it's allocate-on-demand (it uses the same code as the page cache). You don't even need a real ramdisk on Linux for this though because you can specify an exact amount of memory to use on the kernel command-line with the mem= option. Anything beyond what you specify with that will not be used by software (except possibly firmware) at all. – Austin Hemmelgarn Sep 19 '18 at 18:26

Another idea: You can configure a virtual machine with whatever amount of RAM you want and run the app in there to see how it behaves.

| improve this answer | |
  • Paragraph 3 of the question: "Our application also makes heavy GPU demands via OpenGL which makes VMs a tricky option." – K7AAY Sep 19 '18 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.