• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Suggestion on memory allocators

Joined
3/28/11
Messages
3
Points
11
Hello All -
memory allocation operation has been identified as a bottle neck in one of my low latency application. current design uses boost memory pool and hoard.

What kind of optimizations are available in this area ?
Well memory pools are an obvious solutions, what has been the industry experience ?
would like to hear from other their experiences .

thanks
svijayan
 
Hi

What exactly shows that Boost.Pool is a bottle neck and what interface do you use? Is your app multithreaded? Maybe it's not allocator itself but just a contention for the single pointer. Have you looked at other malloc improvements?

As for custom allocators - there is no silver bullet. If your application works in request/response mode you can allocate all the memory for temp variables at once (linear allocator) in a signle request to the malloc function and then just shift the pointer every time you need memory to create a temp variable. It's the easiest one and this is how some of the high performance web servers do their work - allocate once on request, free everything on responce.

You might want to look at game dev to learn about allocators. Anyway, there is a good article about allocators to begin with http://www.spuify.co.uk/?p=454
 
Back
Top