Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

in-process memory outstanding
I'd like to track the allocated (newed) memory in my program.
I've tried using valgrind and looked at some others, leaktracer,
mtrace..
They all seem to track memory loss between the process starting
and exiting.

I want to track memory allocation during user events, while the
process is still running.  My program exits cleanly, deallocating
everything.


I could overload new and delete, do some bookkeeping, say, using
"A Drop-in Debug Memory Manager" from Game Programming Gems 2.
I'm just dealing with a large code base, and I'd need to create a user
command to force writing out the log.
Not a huge deal, but I think a non-compiled in tool should be able to
do this.


thanks for any insight!
cheers

Mark


Report this thread to moderator Post Follow-up to this message
Old Post
kalx
07-18-06 12:00 AM


Re: in-process memory outstanding
kalx wrote:

> I could overload new and delete, do some bookkeeping, say, using
> "A Drop-in Debug Memory Manager" from Game Programming Gems 2.
> I'm just dealing with a large code base, and I'd need to create a user
> command to force writing out the log.
> Not a huge deal, but I think a non-compiled in tool should be able to
> do this.

There are many drop-in malloc replacements that can be arranged to work
at link time. Many of them have usage statistics. Looking at the growth
of the process' virtual address size may be sufficient, unless the
program 'mmap's large files or otherwise causes virtual address usage
to stop correlating with allocated memory. Valgrind has a tool called
'Massif' that may be exactly what you want.

DS


Report this thread to moderator Post Follow-up to this message
Old Post
davids@webmaster.com
07-18-06 12:00 AM


Re: in-process memory outstanding
> There are many drop-in malloc replacements that can be arranged to work
> at link time. Many of them have usage statistics. Looking at the growth
> of the process' virtual address size may be sufficient, unless the
> program 'mmap's large files or otherwise causes virtual address usage
> to stop correlating with allocated memory. Valgrind has a tool called
> 'Massif' that may be exactly what you want.


Hey, thanks for pointing me to Massif!
I tried it out, and as advertised, it gives usage statistics.

I would prefer to be able to pick a time to query the allocated
objects in detail, and compare with another time..
while the process is running.

Can you recommend something that will keep track of
allocations and give me access to dump to a log?

I want to know specifically which objects are allocated
between some user events.


thanks again!


Report this thread to moderator Post Follow-up to this message
Old Post
kalx
07-19-06 12:01 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:26 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.