Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is dynamic memory allocation handled when extreme reliability is required?

Looks like dynamic memory allocation without garbage collection is a way to disaster. Dangling pointers there, memory leaks here. Very easy to plant an error that is sometimes hard to find and that has severe consequences.

How are these problems addressed when mission-critical programs are written? I mean if I write a program that controls a spaceship like Voyager 1 that has to run for years and leave a smallest leak that leak can accumulate and halt the program sooner or later and when that happens it translates into epic fail.

How is dynamic memory allocation handled when a program needs to be extremely reliable?

like image 310
sharptooth Avatar asked Feb 27 '23 09:02

sharptooth


1 Answers

Usually in such cases memory won't be dynamically allocated. Fixed sections of memory are used to store arguments and results, and memory usage is tightly controlled and highly tested.

like image 141
Ignacio Vazquez-Abrams Avatar answered Mar 22 '23 23:03

Ignacio Vazquez-Abrams