Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
2421 Discussions

When does TBB scalable allocator clean its buffers

Ritwik_D_1
Beginner
161 Views

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

 

0 Kudos
1 Reply
Alexei_K_Intel
Employee
161 Views

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.

Regards, Alex

Reply