Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-22-2008, 11:42 AM   #1
LQ Newbie
Registered: Jul 2008
Posts: 1

Rep: Reputation: 0
Question 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
Old 07-23-2008, 01:20 AM   #2
Registered: Jul 2003
Location: London, UK
Distribution: FreeBSD, OpenSuse, Ubuntu, RHEL
Posts: 417

Rep: Reputation: 33
Take a look at pmap.
Old 07-23-2008, 07:50 AM   #3
Registered: Jan 2004
Location: Munich
Distribution: SuSE 9.2, 10.2, 10.3, knoppix
Posts: 276

Rep: Reputation: 31
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).



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to view the contents of memory at a particular address kushalkoolwal Linux - Software 2 06-04-2008 06:05 PM
How do i determine my IP address? How do i determine my host name? jwymore Linux - Networking 5 02-07-2007 09:57 AM
Can't Determine IP Address basketkase999 Linux - Networking 4 11-20-2005 07:42 PM
How do I determine a computer's IP address? njschroe Linux - General 4 05-04-2005 05:53 AM
Determine IP Address with DHCP rock9604 Linux - General 3 08-20-2004 05:32 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:08 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration