Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
I'm porting a C Edge application to a bare-metal microcontroller platform with around 64K RAM, and hitting problems with malloc running out of memory, although the stack gets through the API connection ok. Running the same code on linux, the heap high-water mark seems to settle around 140K, and since many of the malloc requests are around 16 bytes there's obviously a significant memory manager overhead, so the actual memory in use may not be way off the available limit - but can't really do without a mem manager ! Interestingly the newlib embedded malloc performs somewhat worse than the linux version, getting rapidly fragmented with lots of small blocks, however this version could be replaced if necessary.
Has anyone managed to run on a similarly limited platform with more than a trivial application, or found a way to reduce the malloc activity without changing core TW functions ? As this Thing has more than 100 properties, we could look at avoiding the Primitive_CreateFrom calls every time a property is changed, but need to keep the code portable.