This is the same problem as a long web server or something like an integrated control system in a heating and ventilation system.
When I worked at Potterton and then at Schlumberger in the building energy management sector, we did not use dynamic memory allocation. We had fixed size blocks. This block will be used for a specific purpose and nothing else. The sizes of the blocks determined how many of them can be, so you can choose X from this and Y from this function, etc.
Sounds are limited, but for fixed, discrete tasks, that was enough.
This is important, because if you are mistaken, you can blow up the boiler and take half of the school building with you: - (
Summary. In some situations, you generally avoid dynamic memory.
source share