This should fill my memory every second with ca 100 MB. I track the memoryusage with gnome-systemmonitor and htop. But somehow it does not. Why?
#include "unistd.h"
#include <iostream>
int main(int argc, char *argv[])
{
while (true){
std::cout << "New one" << std::endl;
new char[100000000];
sleep(1);
}
return 0;
}
To run:
g++ -std=c++11 -O0 main.cpp; ./a.out