[英]TBB allocation issuing a kill signal
My C++ program (running on Mac OS) got killed.我的 C++ 程序(在 Mac OS 上运行)被杀死了。 Upon running with a debugger, I obtain the following:
使用调试器运行后,我获得以下信息:
Process 90937 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGKILL
frame #0: 0x000000010001fc50 captureISO`tbb::interface9::internal::start_for<WDutils::Parallel::details::blocked_range_terminating<unsigned long>, (anonymous namespace)::simulations::sampleSome(bool)::$_2, tbb::auto_partitioner const>::run_body(WDutils::Parallel::details::blocked_range_terminating<unsigned long>&) [inlined] tbb::concurrent_vector<(anonymous namespace)::simulations::initialCondition, tbb::cache_aligned_allocator<(anonymous namespace)::simulations::initialCondition> >::push_back(this=0x00007fff5fbfebd0)::simulations::initialCondition const&) at concurrent_vector.h:846 [opt]
843 iterator push_back( const_reference item )
844 {
845 push_back_helper prolog(*this);
-> 846 new(prolog.internal_push_back_result()) T(item);
847 return prolog.return_iterator_and_dismiss();
848 }
849
So, it appears that the kill signal was issued by allocation within tbb::concurrent_vector<>
.因此,
tbb::concurrent_vector<>
信号似乎是由tbb::concurrent_vector<>
内的分配发出的。 However, neither the documentation for tbb::concurrent_vector::push_back()
, nor that for operator new
suggest such action.但是,
tbb::concurrent_vector::push_back()
和operator new
的文档都没有建议这种操作。
Is this an undocumented behaviour of TBB (prefer to kill the running process, because TBB cannot deal appropriately with exceptions)?这是TBB未记录的行为吗(宁愿终止正在运行的进程,因为 TBB 无法适当处理异常)? How can I find out and how can I avoid this?
我如何才能找出以及如何避免这种情况?
You probably need to optimize your algorithm to use less memory.您可能需要优化算法以使用更少的内存。
I don't know how macOS handles memory allocation, but on Linux, if you use too much memory, " OOM Killer " will send the SIGKILL signal.我不知道 macOS 是如何处理内存分配的,但在 Linux 上,如果您使用太多内存,“ OOM Killer ”会发送 SIGKILL 信号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.