#include using std::cout; using std::endl; int main(int argc, char** argv) { int i = 0; while (1) { cout << "Alloc " << ++i << endl; int* x = new(std::nothrow) int [0x40000]; if (!x) { cout << "failed to allocate memory" << endl; break; } } return 0; }