Dynamic memory allocation approaches for C++ apps - pros and cons

Robert S. Grimes rsg at alum.mit.edu
Fri Nov 30 23:43:36 UTC 2007


Hi,

I'm just looking for some advice and pointers here - no specific 
problems (yet!)...

What are the relative pros and cons of the various available dynamic 
memory allocation approaches in modern RTEMS applications?  One choice 
is the C++ operators new/delete, which presumably call malloc and free 
under the covers.  What are the characteristics wrt determinism, 
fragmentation, etc.?

What about the alternatives - regions and partitions?  Excuse me if I'm 
way off base here, but are these still in use?  (I seem to remember 
reading something about them being obsolete, but I can't confirm that.)

It would seem that partitions would be ideal for dealing with fixed-size 
(or nearly fixed ;-) ) requests.  Is it safe to assume that this is the 
ideal choice for this sort of application?

How about Regions?  All I've seen is a note that freeing memory is 
O(constant).  Is this the way to go?

What about the Heap itself?

Thanks,
-Bob





More information about the users mailing list