I'm trying to do some development with TBB (& intel compiler v11.1.060) but currently my program is crashing with some memory problems. I'm only linking with tbb.dll, not tbbmalloc.dll or tbbmalloc_proxy.dll, but when I set TBB_VERSION to 1 and then run my program I get the following output:
TBB: VERSION 2.2 TBB: INTERFACE VERSION 4002 TBB: BUILD_DATE Wed, 9 Dec 2009 09:42:44 UTC TBB: BUILD_HOST FXEOWIN16 TBB: BUILD_OS Microsoft Windows [Version 5.2.3790] TBB: BUILD_CL Microsoft 32-bit C/C++ Optimizing Compiler Version 1 4.00.50727.762 for 80x86 TBB: BUILD_COMPILER Intel C++ Compiler Professional for applications runn ing on IA-32, Version 11.1 Build 20090903 Package ID: w_cproc_p_11.1.046 TBB: BUILD_TARGET ia32 TBB: BUILD_COMMAND icl /nologo /Qvc8 /MD /O2 /Zi /EHsc /GR /Zc:forScope /Zc :wchar_t /Oy /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32 _WINNT=0x0400 /D_USE_RTM_VERSION /D__TBB_BUILD=1 /W3 /WX TBB: TBB_USE_DEBUG 0 TBB: TBB_USE_ASSERT 0 TBB: DO_ITT_NOTIFY 1 TBB: ALLOCATOR scalable_malloc TBB: RML private TBB: SCHEDULER Intel
This claims that scalable_malloc is being used, even though I don't see how it could be (per the docs anyway). Is this incorrect? I'm wondering if it is somehow interfering with the main memory system, causing my crashes -- though that seems unlikely.
A related question: actually I would like to try the scalable allocator, but my program is loaded as a plugin to python. Is there a way to replace the main allocator without recompiling python?
"TBB: ALLOCATOR scalable_malloc" means that tbb.dll itself uses scalable allocator. It should not affect otherapplication or runtime libraries. You can try to switch to standard malloc by renaming tbbmalloc.dll which is next to tbb.dll or which can be found in %path%.
You can try to replace scalable allocator in python via plugin by removing "&& reserved" substring from src\tbbmalloc\proxy.cpp file. then you need to rebuild tbbmalloc_proxy.dll and link with it via including tbbmalloc_proxy.h. But this will cause performance degradation on free() calls for memory which was allocated before your pluginis loaded.
Look atReplaceFunctionWithStore() function in proxy.cpp. There is printf() to stderr and exit(1) in case required routine was not substituted.
Another option is to set breakpoint in scalable_malloc and look at stack or put a few trace messages to the allocator. Yet another option is to enable traces in allocator. But this might be huge amount of data.