How can I tell where my memory is used?

Is purify the tool that I want?  

I assume that my memory usage is primarily on
the heap (i.e. malloc'd) but I am not 100% familiar
with the code that I am llooking at so I don't
rule out some stack space problem.

Thanks,
  Ken
klopterAsked:
Who is Participating?
 
arjenveConnect With a Mentor Commented:
I don't know if purify is available for
this platform...
If you have the source code for your
program you can try out
dmalloc (http://www.dmalloc.com/)
it is free, and it can keep
a detailed log of all malloc and
free calls ( including strdup etc.)
I do not know if it runs on a 64bit platform

0
 
sumant032199Commented:
What does that all mean?
0
 
klopterAuthor Commented:
malloc() allocates memory on the heap.
malloc() is used when you don't know
how much memory you will need in advance
and when memory is only needed temporarily.

free() de-allocates memory from the heap.
Every call to malloc() should be
paired with a call to free()
when the space malloc'd is no longer needed.

In C++, new replaces malloc, and
delete replaces free.

Note:  This description is sloppy and
will undoubtably irritate someone.

Ken
0
IT Degree with Certifications Included

Aspire to become a network administrator, network security analyst, or computer and information systems manager? Make the most of your experience as an IT professional by earning your B.S. in Network Operations and Security.

 
NT_ProgrammerCommented:
What exactly is the problem you are experiencing?
0
 
klopterAuthor Commented:
Virtual memory size exceeded.

I discovered that I can get more space
by typing "limit datasize 2000M" but
this is only a temporary fix at
some point I am going to have to
figure out exactly where my memory usage
is and whether I have a memory leak.

Ken
0
 
sreenathkCommented:
R U using a RTOS or any propritery OS, because some systems such as NUCLEUS RTOS gives a variable called first_available_memory which indicates how much memory is left out. In the same way this system calls are propritery to the OS. Just I like to know on which platform you are working.
0
 
NT_ProgrammerCommented:
You can eliminate the stack as a source of your problem by the error you indicated.

What programming platform are you using?
0
 
klopterAuthor Commented:
My platform is a Compaq true64 Unix or something like that.
0
All Courses

From novice to tech pro — start learning today.