Gem #43: Safe and Secure Software : Chapter 7, Safe Memory Management Author: John Barnes Abstract: Welcome back the Ada Gems series! We hope you had a great summer. Gem #43 is the seventh chapter of John Barnes new booklet: Safe and Secure Software: An Introduction to Ada 2005. Over the coming months, we will be publishing all thirteen chapters of the booklet. In the attachment at the bottom of Gem #30 you can access the contents and bibliography for the entire booklet. Let s get started ¦ The memory of the computer provides a vital part of the framework in which the program resides. The integrity of the memory contents is necessary for the health of the program. There is perhaps an analogy with human memory. If the memory is unreliable then the proper functioning of the person is seriously impaired. There are two main problems with managing computer memory. One is that information can be lost by being improperly overwritten by other information. The other is that the memory itself can become filled and irrecoverable, so that no new information can be stored. This is the problem of memory leaks. Memory leak is an insidious fault since it often does not show up for a long time. There was an example of a chemical control program that seemed to run flawlessly for several years. It was restarted every three months because of some external constraints (a crane had to be moved which necessitated stopping the plant). But the schedule for the crane changed and the program was then allowed to run for longer it crashed after four months. There was a memory leak which slowly gnawed away at the free storage. Read Chapter 7 in full Note: All chapters of this booklet will, in time, be available on the Ada 2005 home page. Related Source Code Ada Gems example files are distributed by AdaCore and may be used or modified for any purpose without restrictions. Ada Letters, April 2009 Volume XXIX, Number 1
/lp/association-for-computing-machinery/gem-43-safe-and-secure-software-chapter-7-safe-memory-management-KdnEalGeD2