MFC "Failed to create empty document" only in debug setting in Visual Studio

When I run my MFC SDI application, the "Failed to create empty document" pop-up message occurs at startup only in the debug setting. I checked this question (MFC error "Failed to create an empty document" in Release mode only) but couldn't get any hint. It seems that 'clean solution' (function in Visual Studio) should be done to reproduce this difference between the default debug/release setting. I also found that CFrameWnd::OnCreate(lpCreateStruct) fails in CMainFrame::OnCreate :

// MainFrm.cpp int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) < if (CFrameWnd::OnCreate(lpCreateStruct) == -1) < ::AfxMessageBox(_T("Failed.")); // //. > 

What could be the causes of this problem? And how the configuration setting(debug/release/etc.) can affect this? Thanks. Edit:
Thanks to @xMRi and @IInspectable's advice, it seems that vector.reserve(100'000'000) in my custom view's OnCreate (i.e. CmyView::OnCreate ) was the cause of the above error message. I changed the value to 10'000'000 and the error message does not pop up anymore. The exact type of that vector is std::vector> . So, I guess memory shortage was the problem. FYI, I used 32-bit setting in Visual Studio, in Windows(x64). I set a breakpoint on that line( vector.reserve ) and used "step into", and I saw this comment:

// destroy [_First, _Last), choose optimization
// note that this is an optimization for debug mode codegen;
// in release mode the BE removes all of this

I don't know what BE means, but it seems that this kind of differences between debug/release mode in Visual Studio made the aforementioned error message pops up only in debug mode. Any additional advice would be helpful. Thanks.