Memory Error in Visual Studio, but plenty of memory available

蹲街弑〆低调 提交于 2019-12-11 20:39:38

问题


This line of code produces the following error

rs[se_idx][ev_idx][re_idx].trs = new re_class[report_size];  

std::bad_alloc at memory location 0x0037c29c

I think this is related to 'not enough memory'. When I decrease the amount being allocated, it runs fine.

I have plenty of memory (16 GB) on the machine and a resource monitor shows only a tiny fraction of it is being used by visual studio. I added the compiler options /F 4000000000 and /LARGEADDRESSAWARE, but still getting the error.

How can this be solved?


回答1:


Are you sure your operating system can take advantage of the entire 16GB and you're using a 64 bit version of VC++

http://msdn.microsoft.com/en-us/library/h2k70f3s%28v=vs.90%29.aspx

http://msdn.microsoft.com/en-us/library/9yb4317s%28v=vs.90%29.aspx



来源:https://stackoverflow.com/questions/10554876/memory-error-in-visual-studio-but-plenty-of-memory-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!