If I am NOT setting a soft heap limit with scalable_allocation_mode (TBBMALLOC_SET_SOFT_HEAP_LIMIT, <size>) what is the default limit id there is one? And when does TBB actually start cleaning up its internal buffers? I am using TBB 4.4.5
There is no any soft limit by default. I.e. the TBB allocator does not try to fit into some amount of memory. There are two moments when the TBB allocator returns memory to the OS. The typical moment is when the object is deallocated and the logic of caching decides to return memory. And the exceptional moment when during allocation, memory cannot be allocated from the OS or the soft limit is reached. Then the allocator tries to find available memory in its internal buffers.