boost_multi阵列太大?bad_alloc错误
boost_multi array too large? bad_alloc error
我正在编写一个程序来测试一个功能。但是,当我声明具有一定大小的 boost::multi_array 时,我会收到错误。我收到以下错误:
在抛出"std::bad_alloc"实例后终止调用 什么((: 标准::bad_alloc
我的代码如下所示:
#include <boost/multi_array.hpp>
#include <boost/array.hpp>
boost::multi_array<double,3> test ;
test.resize( boost::extents[1000][1000][1000] ) ;
如果我声明 2D multi_array或声明大小为 10x10x10 和 100x100x100 的 3D multi_array,我不会收到错误。
有人有任何想法来解决这个问题吗?这个问题编译器是否相关还是什么?
我使用Qt creator执行代码,并使用MinGW编译器。
在我的项目后期,我将使用维度为 12/13 的数组,每个维度的长度在 100 到 1000 之间,所以我真的需要它来工作。
提前感谢!
RAM 内存超出。
双精度占用 8 字节 -> 1000x1000x1000 双精度 = 8 GB 所需的 RAM。
相关文章:
- 使用来自 Excel VBA 的 C++ dll 时"Bad DLL calling convention" - 如何解决?
- C++17 编解码器在将标准::字符串转换为标准::字符串时抛出"bad conversion"
- 对于代理容器上的迭代器来说,"least bad implementation"可能是什么?
- 组件对象模型 (COM):IMalloc::Alloc 在哪里分配内存?
- 获取错误:在抛出"std::bad::alloc"的实例后终止调用 what(): std::bad_alloc
- 为什么 GetSystemMetrics (SM_CXVIRTUALSCREEN) 返回'bad'值?
- 将 lambda 传递给 STL 集时出错"bad function call"
- 新的 C++14 位分隔符处"Bad Character" Eclipse Oxygen 错误
- 使用 #define 被认为是"bad practice"吗?
- "400 Bad request"使用 OpenSSL BIO 进行请求时
- CGAL:Hausdorff距离不良Alloc
- 解密文件AES_256_CBC返回"bad decrypt"错误
- 在C++流中,eof(),fail(),bad()和good()有什么区别
- C STD ::初始化类对象中的Alloc错误错误
- make / gcc:"bad build"的可能原因是什么?
- 什么是地址0xbaddc0dedeadbead "Bad decode dead bead"
- 在多线程环境中,什么可能导致"bad file descriptor"?
- 尝试解决HackerBank上的BFS挑战时出现错误的alloc异常
- "std::vector"在调整大小时引发"bad allocation"异常
- 尝试使用 execp、dup2 和管道实现 shell,挂起或"bad file descriptor"