#include <stdlib.h> class ThrowsException { public: ThrowsException() { char *fill=new char[100000]; throw 0; } }; int main() { while (1){ try { ThrowsException dummy; dummy; } catch(...) { } system("sleep 1"); } }
The program will
1:
exhaust memory
2:
not exhaust memory