?
Solved

How to determine memory location of a variable in Visual Studio Debugger

Posted on 2011-03-20
4
Medium Priority
?
931 Views
Last Modified: 2013-11-27
I'm running in the Visual Studio debugger and I have a line of code:
sa[j,1] = fn;

Open in new window

and I want to find out where these variables are stored in memory, the actual memory address of fn, j, and array sa. How can I determine that?
0
Comment
Question by:deleyd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1000 total points
ID: 35175782
I'm not sure if this is the answer for your particular scenario, but you can try  using the Memory window. Make sure you have "Enable address-level debugging" checked under Options->Debugging, then go to Debug->Windows->Memory->Memory[1,2,3,4]. In the new window that display after you pick one of the four available under the Memory menu, you will have a box that says, "Address." In here, you can type the name of your variable (while you are in debugging mode and while that variable is in scope) and hit Enter. The variable name you typed in should change to the variable's address once you hit enter.
0
 
LVL 47

Assisted Solution

by:David
David earned 1000 total points
ID: 35178537
What do you *really* want to know?   The reason is that the memory location (or footprint) used when a program is debugging is never going to be the same when program is running in production, nor will it be the same from invocation to invocation, or even at any point of time due to virtual memory.

0
 

Author Comment

by:deleyd
ID: 35194602
I want to learn what's going on under the hood. I have a 2-D array of strings, sa, and I'm wondering how it' implemented. Is it an array of pointers to strings? Is the array stored in memory in row-major order or column-major order?

I'm always concerned about speed and efficiency. I don't just want to know that it will work, I want to know that it will work fast. I'd like to know how things like the generic Dictionary are implemented internally. I want to know what's going on under the hood.

Is there a good book explaining the internals of these things?
0
 

Author Closing Comment

by:deleyd
ID: 35409241
just want to close out this old question
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question