Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-20
4
Medium Priority
?
938 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Screencast - Getting to Know the Pipeline

610 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