Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messagekalx 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
Post Follow-up to this message> 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!
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.