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.

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 (
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

What does that all mean?
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.

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.

What exactly is the problem you are experiencing?
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.

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.
You can eliminate the stack as a source of your problem by the error you indicated.

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

From novice to tech pro — start learning today.