It's more that there is no defined maxiumum heap size, rather than it being a dynamic limit.
As for your issue, I can only say "it is possible", as I do not know much about your system. Three things you could try:
- Create a fixed-size ring buffer instead of dynamic allocation
- Create a hard fault handler as seen in that thread I linked to - if it does trigger blue lights of death, then the chances are that you have a heap/stack collision (not for certain, but likely).
- Create a watchdog which can reset you if you do get locked up - again an example of this is in that thread 433.
Something that may assist understanding is does it lock up almost immediately, or does it run for a bit then fall over? Also, are you allocating a big chunk 'o memory at/near the beginning, or just bits as and when needed? If you are allocating lots of little bits, the more of these you have being used (and not being freed), the less efficient in memory the malloc()s become, as it allocates larger chunks.
Another possibility that I cannot ignore is that the Serial transmit interrupt attach is new, and although I have tested it quite a bit, it is possible there is a bug in it.
Hi,
I searched the forum and see that others have asked this question but I can't see where it has ever been answered completely. What is the amount of memory allocated to the heap on an LPC1768 mbed?
I program the Philips LPC2138 using Keil in addition to working on the mbed. In the LPC2138 program, there is a definition of HEAPSIZE in startup.s where the size is defined. Is there a similar definition in the mbed startup file?