From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c70f02b79bc3d231 X-Google-Attributes: gid103376,public From: Samuel Mize Subject: Re: dynamic memory allocation Date: 1997/06/16 Message-ID: <33A5B512.5FD4B913@link.com>#1/1 X-Deja-AN: 248925299 References: <33A55F1B.63FE@gsfc.nasa.gov> Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-06-16T00:00:00+00:00 List-Id: Stephen Leake wrote: >I > have suggested that the heap could become fragmented (the buffers are > NOT all the same size). They say "we'll just test it thoroughly". This is pathetic. On the other hand, you say the messages are not all the same size. If they of specific-size message types, AND you can derive a maximum number that will need to exist at any time, each message type can have its own storage pool. The result is that there is not one heap being fragmented, each message type has its own chunk of memory to allocate from. If you can define a maximum number for each type, you can ensure you will always have enough memory. If the buffers are of variable size, fragmentation certainly might occur. If you can't define a maximum number of messages to be handled at a given moment, you can't define how much memory you will need to begin with (you can determine "likely to be OK" but not "proven to be OK no matter what"). > Can anyone provide a reference to a book or study article that > says this is bad? To me it seems obvious, and the general tone > in this newsgroup is that it's obvious. I have a couple books on > realtime embedded design, and they don't even bother to mention > dynamic allocation - unfortunately, that makes it hard to say > "see, this book says it's bad". > > On the other side, are there any discussions of how to test such a > system, to show that it does not become fragmented? Or a book on > designing dynamic memory allocation algorithms to avoid fragmentation? Real-time embedded system developers tend to avoid dynamic memory, so it's not surprising that your references don't mention it. I don't have a reference, but I suggest you look at books outside the embedded real-time domain. Real-time embedded system developers have tended to avoid dynamic memory, so you won't find much in that literature. Best of luck with it, Sam Mize -- -- Samuel Mize (817) 619-8622 smize@link.com "Team Ada" -- Hughes Training Inc. PO Box 6171 m/s 400, Arlington TX 76005