ABSTRACT

The majority of the discussion in this book about resource management has to do with data that is transferred to video memory to be used by the graphics system. This data includes vertex and index buffers, vertex and shader programs, and texture images. Memory management in video memory is the responsibility of the graphics drivers. Whether the data resides in video memory or in accelerated graphics port (AGP) memory is up to the drivers to decide, although you might be allowed to provide hints about where to store items based on how frequently you plan on modifying those items. On the other hand, system memory is your responsibility. This is yet another resource that must be properly managed. This chapter contains some basic information about memory mangement. The topic is quite broad and has been studied extensively over the years. For a broader and deeper discussion than that provided here, you will need to do some research on your own. As always, the quintessential reference is Donald Knuth’s famous book series [Knu73]. (For online references, using your favorite Internet search engine, a search on the key words “memory management” will produce a significant number of hits. A well-written online reference is [Lim01].)

19.1 Memory Budgets for Game Consoles When you are raised on desktop computers, memory management is a simple matter of allocating and deallocating memory from the global heap whenever you must. In C, you do this with malloc and free. In C++, you do this with calls to the global new and delete operators. Desktop computers tend to have an enormous amount of physical memory, so you probably are infrequently concerned about exceeding the limits.