Using the Memory Window

Note   This feature is not available for languages such as script and SQL that do not support the concept of memory.

You can use a Memory window to view large buffers, strings, and other data that do not display well in the Watch or Variables window. In the Visual Studio debugger, you can open up to four Memory windows.

To display a Memory window

When viewing memory contents in a Memory window, you can use the vertical scrollbar to move up or down in the memory space. You will notice that the higher addresses appear at the bottom of the window. To view a higher address, you must move down, not up.

To page up or down in memory

You will also notice that the vertical scrollbar operates in a nonstandard fashion. The address space of a modern PC is huge, and it would be easy to get lost by grabbing the scrollbar thumb and dragging it to a random location. For this reason, the thumb is "springloaded" and always remains in the center of the scrollbar. You can page up or down, but cannot scroll about freely.

If you want to move instantly to a selected location in memory, you can do so by using drag and drop or editing the value in the Address box.

The Address box accepts expressions as well as numeric values. By default, the Memory window treats an Address expression as a live expression, which is reevaluated as your program executes. Live expressions can be quite handy. For example, you can use them to look at the memory that is touched by a pointer.

In native code applications, you can also use register names as live expressions. You can use the stack pointer to follow the stack, for example.

If you do not want the contents of the Memory window to change as your program executes, you can turn off live expression evaluation.

You can customize the way the Memory window shows memory contents. By default, memory contents appear as long data types in hexadecimal format, and the number of columns is determined automatically by the current width of the window.

You can hide or display the toolbar at the top of the Memory window. (You will not have access to Address box or other tools while the toolbar is hidden.)