4 ms·
But for this kind of application, wouldn't you just panic and do a soft restart on malloc failure anyway? Actually recovering from an out-of-memory situation is
by david-given 11y ago
But for this kind of application, wouldn't you just panic and do a soft restart on malloc failure anyway? Actually recovering from an out-of-memory situation is incredibly fraught and unreliable; most of the realtime operating systems I've used don't even bother to try.
- duaneb 11y agoEven then you'd want proper logging and panicking over a segfault (the likely result).
- david-given 11y agoIn such an environment, malloc() will do that.
- gibsjose 11y agoThat depends on when a failure were to occur. If we have a failure while the spacecraft is en route to its destination, perhaps we can recover because we may have enough time. If we have a failure during rendezvous with our target, it could be a very bad day.
- TickleSteve 11y agoDynamic memory allocation is extremely frowned-upon in embedded/real-time systems such as flight systems for exactly that reason. You simply cannot handle out-of-memory and fragmentation issues in a safe manner.
- david-given 11y ago...necropost, but: You always need to be able to recover from a soft reboot, even during maneuvers; you're in a high radiation environment and any passing high energy particle or cosmic ray can trigger this.