This preview shows page 1. Sign up to view the full content.
Unformatted text preview: leaks are particularly serious for programs such as daemons and servers, which by deﬁnition never terminate. 556 CHAPTER 10. VIRTUAL MEMORY 10.12 Summary
In this chapter, we have looked at how virtual memory works, how it is used by the system for functions such as loading programs, mapping shared libraries, and providing processes with private protected address spaces. We have also looked at a myriad of ways that virtual memory can be used and misused by application programs. A key lesson is that even though virtual memory is provided automatically by the system, it is a ﬁnite memory resource that must be managed wisely by the application. As we learned from our study of dynamic storage allocators, managing virtual memory resources can involve subtle time and space trade-offs. Another key lesson is that it is easy to make memory-related errors from C programs. Bad pointer values, freeing already free blocks, improper casting and pointer arithmetic, and overwriting heap structures are just a few of the many ways we can get in trouble. In fact...
View Full Document