LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How can I determine the memory starting address of my c++ program? (https://www.linuxquestions.org/questions/programming-9/how-can-i-determine-the-memory-starting-address-of-my-c-program-657464/)

myhouri 07-22-2008 11:42 AM

How can I determine the memory starting address of my c++ program?
 
Hello folks,

My multithreded C++ program uses a large amount of memory, but there are no memory leaks.
I tried to find memory leaks using valgrind, but it couldn't find any.
Now, I'm trying to dump the memory used by my program to find out what part of my program uses this amount of memory.
gdb provieds a command "dump [format] memory filename start_addr end_addr" to save the memory into a file.
My question is:
How can I find the starting and the end address of multithreaded C++ program?

Thank you in advance
Yaser

jcookeman 07-23-2008 01:20 AM

Take a look at pmap.

Marius2 07-23-2008 07:50 AM

How many threads are you using? You should be aware that under linux,
a single thread may be assigned stack space in the vicinity of 10-20MB
(depending on your distribution).
You may want to take a look at ulimit (man ulimit).

HTH


All times are GMT -5. The time now is 09:09 AM.