Visual Studio 中的内存错误,但有足够的可用内存 [英] Memory Error in Visual Studio, but plenty of memory available

查看:54
本文介绍了Visual Studio 中的内存错误,但有足够的可用内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这行代码产生如下错误

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

<块引用>

std::bad_alloc 在内存位置 0x0037c29c

我认为这与内存不足"有关.当我减少分配的金额时,它运行良好.

我的机器上有足够的内存 (16 GB),资源监视器显示 Visual Studio 只使用了其中的一小部分.我添加了编译器选项 /F 4000000000/LARGEADDRESSAWARE,但仍然出现错误.

如何解决?

解决方案

您确定您的操作系统可以利用整个 16GB并且您使用的是 64 位版本的 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

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?

解决方案

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

这篇关于Visual Studio 中的内存错误,但有足够的可用内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆