Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Memory Leak?

renorm
Beginner
416 Views
Visual Studio 2008, WinXP 32 bit, TBB 174oss, Boost 1.46.1.

In debug mode Boost test detects 260 bytes being leaked. It is always 260 bytes regardless of how many tasks were scheduled. After replacing paralell_for with explicit task scheduling the same 260 bytes were leaked. Probably not leak, but nevertheless...
[cpp]#define BOOST_TEST_MODULE tbb_memory_leak_test
#include 

#ifdef _DEBUG
    #ifdef TBB_USE_DEBUG
        #undef TBB_USE_DEBUG
    #endif
    #define TBB_USE_DEBUG 1
#endif

#include 
#include 

struct MyTask
{
    void operator()(const tbb::blocked_range&) const { /*empty*/ }
};

BOOST_AUTO_TEST_CASE( free_test_function )
{
    tbb::parallel_for(tbb::blocked_range(0, 1000), MyTask());
    BOOST_CHECK(true);
}[/cpp]
0 Kudos
1 Reply
Andrey_Marochko
New Contributor III
416 Views
This is most likely a false positive. See e.g. a reply in one of the earlier threads discussing similar symptoms.
0 Kudos
Reply