View RSS Feed

penguinCoder

Virtual Memory Cheat Sheet

Rate this Entry
by , 10-27-2012 at 05:39 AM (2111 Views)
Brief Description:
'Virtual' Memory is the mental model, or abstraction, that the programming language provides to the programmer to explain how computer memory is managed while you program is running. It is NOT the same as physical memory.

Run Time:
At run time, the operating system handles the translation from 'virtual' memory addresses to physical memory addresses, and the programmer does no need to be aware of this process.

Static Region:
This is referred to as the top.
Is called the Static Region because the contents of each location do not change while the program is running.
It contains the code for the program.
Also contains static data members.
The size of this region does not change.

Heap Region
This is referred to as the middle.
Is used for dynamically allocated storage, anything that is created with the keyword 'new'.
Storage in this region is reserved while the program is running.
The same location can be allocated once, then released, and then re-used for something else, over and over; all while the program is running.
NOT to be confused with the Abstract Data Type called 'heap'.

Stack Region
This is referred to as the bottom.
This is where local variables are stored.
Storage is reserved when the method is called, and released when the method exits.
Conceptually, storage is reserved from the bottom up.
When a method is called, the Stack 'grows'.
When a method exits, the Stack 'shrinks'.
Since the last method called is the next to exit, this is a Last-In First-Out Process.
The same location on the stack may be occupied by different variables throughout program execution.
must426 likes this.

Submit "Virtual Memory Cheat Sheet" to Facebook Submit "Virtual Memory Cheat Sheet" to Digg Submit "Virtual Memory Cheat Sheet" to del.icio.us Submit "Virtual Memory Cheat Sheet" to StumbleUpon Submit "Virtual Memory Cheat Sheet" to Google

Updated 10-30-2012 at 05:19 AM by penguinCoder

Categories
Cheat Sheet

Comments