Original Post
Hi,
I am trying to display graphically the memory that my program has allocated. To do this I have overridden new and delete so I can record memory allocations, where they are in memory and their size.
My problem is this, what address should I be using a base address when I am plotting my memory? I know that my computer has 512mb of ram, but with virtual memory, and each process getting its own memory space, what address does my program start getting memory allocated at? Is it even a constant?
I wrote a test program to allocate some memory and print the address it was allocated at:
The lowest address I get is 0x003210E0. Not exactly the nice round number I was hoping for.
Any ideas or suggestions? Or can anyone point me in the direction of some specification that details where programs allocate memory?
Thanks in advance,
Alan
int *p[10];
for (int i = 0; i < 10; i++)
{
p[i] = new int[10];
std::cout << p[i] << std::endl;
}