On Thu, 15 Oct 2009 12:00:49 -0300, Gerhard Fiedler wrote: >Vitaliy, you never explained how you can make heap usage predictable. Of >course I don't mind if you disagree -- as I see it, this is your problem >not mine --, but thing is that as long as you just say "believe me" >without presenting any further explanation, I for one won't believe you >and take the lack of further explanation for an absence of good >arguments :) Come on, if you can predict memory usage for static allocation at compile time then you can predict heap usage for dynamic allocation at run time because it is the same. What is harder to predict is how much free heap is unavailable due to fragmentation. That depends on the nature, size, and lifetime of the allocations. That doesn't mean you can't make a good enough prediction and various measures can be taken to mitigate fragmentation. The problem with static allocations is being sized for worst case conditions they all have a lot of wasted free space most of the time. Dynamic allocation lets you share that free space (or contingency) between all types of allocation. Will free space on the heap lost to fragmentation ever be larger than the free space lost to static allocation contingency? I would say you probably have to deliberately design a system with unfortunate allocation patterns to make that true. Unpredictable time to make and free allocations may be another issue with dynamic allocation. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist