0

I'm studying the I/O efficiency of an algorithm written in c++ and I need to test the performance on a machine with 256MB of ram. Is there any way to boot up my Ubuntu machine in console mode with just 256MB of main memory? Thanks, Stefano

pedro.zena
  • 391
  • 1
  • 4
  • 16

1 Answers1

1

There are several ways to do this:

  1. You can install virtualization software on your computer (VMWare, VirtualBox, ...). The software will allow you to create a virtual PC with the amount of RAM that you want for your test. The software will allow you to change the memory size very quickly.

  2. You can boot linux with the kernel option mem=256m. See here.

  3. At the beginning of your code, you can ask for the amount of free memory and allocate a huge chunk so that only 256MB are left free.

  4. You can run your code with a profiler and ask how much memory it used.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820