Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7541493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:54:25+00:00 2026-05-30T07:54:25+00:00

I am doing my Computing Science project. I am doing Multiprocessor programming using C.

  • 0

I am doing my Computing Science project. I am doing Multiprocessor programming using C. One requirement for us it that, we cannot keep allocating small chunks of memory. Memory can be allocated in big chunks when needed.

So imagine I use structures in my program. And the way that my program works requires dynamic memory allocation. But it is very costly in the hardware that we are using. So the best solution would be to allocate a big pool of memory at the beginning and whenever needed allocate memory from this pool.

The way I envision this to work is that, I will allocate a bit array of these structures and write my own memory management module which allocates and frees memory from this pool. But I want to know the most ideal way to write these modules. Are there any libraries which can assist me in managing memory or is there some way that these can be written?

EDIT: Here is the platform that I use: an AMD opteron system which runs Ubuntu. The opterons has NUMA architecture and I want to make use of this when allocating memory. Hence instead of using malloc, I use numa_alloc_onnode which allocates memory on one specific node. I want to allocate a big chunk of memory using this and then use a memory manager to manage this memory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:54:26+00:00Added an answer on May 30, 2026 at 7:54 am

    There are a ton of memory pool managers out there, some commercial and some open source. Have a look at them, and feel free to ask more specific questions here after you have an overview.

    Some google results (c memory pool manager open source):

    http://256stuff.com/sources/mpool/

    http://www.ravenbrook.com/project/mps/

    Here’s a good article from IBM on the subject:

    http://www.ibm.com/developerworks/linux/library/l-memory/

    And since you mention a multiprocessor environment (although not directly related to memory management), this is also a worthwhile read:

    http://drdobbs.com/go-parallel/article/showArticle.jhtml?articleID=217500206

    UPDATE

    There are different approaches depending on the desired portability of the library. If portability is important, the library presents a wrapper around malloc (or calloc) to grab chunks of memory and then apply a more efficient implementation (as measured against the particular goals the library wants to achieve). A library that targets a specific OS will typically use native operating system calls, gaining some performance and the ability to leverage specifics of that operating system at the cost of portability.

    The specific goals that memory management libraries strive for vary. Here are some goals I have seen over the years:

    • Separate management strategies for large vs. small objects
    • Separate management strategies for things that will live long vs. things that will be deleted rapidly
    • Debugging for memory management issues (e.g. write a specific pattern into allocated memory and allocate some extra padding on the end so that a debug function can see if the padding was overwritten by an out-of-bounds pointer access)
    • Faster memory access given constraints of a particular platform (e.g. some allocations may be expensive, others relatively cheap).
    • Support memory defragmentation (e.g. by really allocating a pointer to a pointer, with special semantics for accessing memory).

    UPDATE 2

    Based on your update… my fourth bullet point applies. Here’s a good read on creating a heap manager for a NUMA architecture (source code at the end of the article):

    http://ebookbrowse.com/numa-aware-heap-memory-manager-article-final-pdf-d12526838

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a project that involves comparing programming languages. I'm computing the Ackermann function.
I am doing a remote computing project in Java. Using the Robot class I
I'm doing a little home computing project in PHP and am creating references like
I recently found a DNA Computing Algorithm (not genetic programming or genetic algorithms) that
I have a computing map (with soft values ) that I am using to
I have been doing a little recreational holiday computing. My mini-project was a simulation
My job is mainly in high-performance 'scientific' computing. I've been doing that for ~15
I am doing a computing-intensive benchmark using Mathematica and its J/Link Java interface. The
I am doing my A2 computing project in Delphi and have encountered a problem
I'm working on a small distributed computing project. The server can't handle the calculations

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.