- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While profiling my application I found that a lot of time was being spent on the memory allocation and deallocation so I switched to tbb scalable allocator which helped a lot. I have not explicitly changed the code to allocate the memory through scalable allocator but I am linking my application with tbbmalloc_proxy.so library which is doing its job. But still, the profiling tool shows some red areas where I am inserting some data into a map.
So my questing is that, do I need to explicitly define custom memory allocator for map e.g
std::map<const key,T,scalable_allocator<std::pair<const Key, T>>
or just linking to the tbbmalloc_proxy.so library will do the job?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You are using it right. Linking to tbbmalloc_proxy.so library will substitute all standard allocation routines to tbb ones, and that is enough. However, I recommend to try LD_PRELOAD option as described here. It just ensures that tbbmalloc_proxy.so symbols for malloc/free will be loaded firstly.
On the other hand, you can try one of our concurrent containers, if you faced insertion bottleneck.
- Nikita
![](/skins/images/7FC17B7B85029576C25F1E43CE255B51/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page