Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 05-20-2013, 04:32 AM   #1
LQ Newbie
Registered: May 2013
Posts: 8

Rep: Reputation: Disabled
Performance issues in Linux Multi-heap Multi-thread application

We are porting a multi-process application to multi-threaded architecture. We have the same application running on Windows and it is very performant.

For Linux we are using the pthread libraries. In order to avoid memory contention we have custom heaps, each thread having its own heap. We are using mspace for this custom heap implemention. However the issue is that this approach is causing a lot of performance overhead. The mspace memory allocations are very slow as compared to the native malloc. This is the bottleneck. We tried the Hoard allocator but that is much worse.

The performance impact is due to:
1. CPU switching: I see more switching in the LWP than in normal multi-processes
2. Memory allocations: I see mspace taking about 7 to 8 times more time than normal malloc

Is there any alternative to acheive multi-heap which is also performant in Linux?
Old 05-20-2013, 11:46 PM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,670

Rep: Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487Reputation: 2487
I recommend asking the Mods via the Report button to move this to the Programming Forum.
Old 05-21-2013, 01:25 AM   #3
Registered: May 2001
Posts: 29,409
Blog Entries: 55

Rep: Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582
Please post your thread once and in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate of

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-customer, multi-tenancy linux box user authentication LinuxGreen Linux - Server 2 04-27-2012 10:34 PM
[SOLVED] what's the difference between a multi-cpu , multi-core and a multi-thread system ? entz Linux - Hardware 11 12-20-2011 04:49 PM
LXer: Linux powers multi-protocol, multi-frequency wireless switch LXer Syndicated Linux News 0 11-03-2006 09:54 AM
global integer in the multi-thread application lordofring Programming 1 08-23-2005 09:36 PM
multi-thread VS multi-process ltcstyle Programming 3 12-04-2004 06:53 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration