Here is what you can do:
#include <array>
const unsigned int BIG_SIZE = 50 * 1024 * 1024;
int main()
{
std::array<char, BIG_SIZE> *m = new std::array<char, BIG_SIZE>;
std::fill(m->begin(),m->end(),0);
while(1)
;
}
The while loop with use 100% of a single-core CPU.
The array object will eat up the memory. You have to touch it, otherwise the OS will not really assign you that memory.