PDA

View Full Version : Real Time Memory Address Map


BDMcGrew
2009-02-21, 10:34 AM CST
Good morning all, I may be asking for the impossible here but I'll throw it out anyways...

I'm running Fedora Core 5 (please, save the flames, we can't upgrade becuase of third party hardware restrictions). We do a lot with image manipulation so we drop in two or three third party cards PCI cards plus one of our own and, develop our own software. Our software starts many separate and different processes and threads that all do different things but need to talk to each other. We use a common process and mmap() to do this.

That being said, I'm crushing memory somehow using at XtAppProcessEvent() in conjunction with XtAppAddTimeout(). (I know, better suited for a software development list, but I'm just long winded). My fear is that I'm crushing memory that belongs to real hardware or even worse, memory that belongs somewhere in the region where the X11 framebuffers live. Yikes!

Now my question... Are there any tools out there to show me, in real time, what memory (by address/address-range) is being used by what process, thread or hardware??? We compile everything with gcc-4.1 (I know, that's old too). My goal is to be able to attach the debugger (gdb) and break where I'm crushing memory and then be able to look at some kind of a real time map to see exactly what memory is getting crushed and where.

Can anyone point me in the right direction???

Thanks,

-brian

marinaccio
2009-02-21, 11:03 AM CST
http://valgrind.org/

Valgrind is an award-winning instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tools.

The Valgrind distribution currently includes six production-quality tools: a memory error detector, two thread error detectors, a cache and branch-prediction profiler, a call-graph generating cache profiler, and a heap profiler. It also includes one experimental tool, which detects out of bounds reads and writes of stack, global and heap arrays. It runs on the following platforms: X86/Linux, AMD64/Linux, PPC32/Linux, PPC64/Linux. - quoted from their website

Not sure if that helps, but the tools looks pretty useful. Hope that helps, and good luck.