title: Array memory management
body: <p>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.  </p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>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 <strong>numa_alloc_onnode</strong>  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.</p>