C++ (Qt)#include <QtCore/QString>#include <QtCore/QtGlobal>#include <QtCore/QtDebug> enum {MAX = 1000000000}; int main(int /*argc*/, char** /*argv*/){ QString* str = new QString; try { for (int i = 0; i < MAX; ++i) *str += QLatin1String("X"); } catch(...) { qDebug() << str->size(); } return 0;}