www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Diamond, a D Memory Debugger (and profiler)

reply "Vladimir Panteleev" <thecybershadow gmail.com> writes:
I've been working on this project on and off for over a year, and  
presented it as part of my graduation thesis on memory management in D. I  
think I'm done working on it for a while (due to many other projects  
begging for attention), and even though there's still things that could be  
finished or improved, it's quite useful as it is now.

Diamond is a post-mortem memory debugger and profiler. It is composed of  
two parts:
  * a module, which should be imported before any other modules in the  
project to be debugged
  * a memory log analyzer, which allows inspecting generated memory logs

The module logs all memory operations to a file, as well as periodic  
memory snapshots (before garbage collects). Some logging options are  
configurable.

Diamond aims to facilitate debugging memory leaks (data referenced by  
bogus pointers), memory corruption and other problems. It was written for  
D1 (both Phobos and Tango), D2 support is untested at best.

Runtime module features:
  * logs all memory events, with timestamps and call stacks
  * exports C functions, allowing debuggee to log memory maps or snapshots  
at any time, as well as log text comments
  * has optional memory debugging features, like checking free calls and  
stomping on deallocated memory

Log analyzer features:
  * uses map files to display symbols in call stacks
  * can seek through the log file, allowing to examine the application  
state at different points in time
  * can display "top allocators" - call stacks that allocated most bytes
  * can filter memory events by address range
  * can display a visual "memory map" [1] (useful for quickly finding large  
areas the GC shouldn't be scanning for pointers)
  * can search for references (pointers) to a certain memory range
  * can dump a region of memory to screen

Things still to be done:
  * documentation
  * more type information (by hooking higher-level allocators)
  * dumping data segment and thread stacks (currently only the heap is  
dumped)
  * more runtime library options

Project homepage:
http://dsource.org/projects/diamond/

[1]  
http://dump.thecybershadow.net/36ee988fc564aa9ab5529d43662eec81/0000062E.png

-- 
Best regards,
  Vladimir                          mailto:thecybershadow gmail.com
Jun 21 2009
next sibling parent torhu <no spam.invalid> writes:
On 21.06.2009 20:34, Vladimir Panteleev wrote:
    * can search for references (pointers) to a certain memory range

Nice, I'll have to try this tool out.
Jun 21 2009
prev sibling parent reply Extrawurst <spam extrawurst.org> writes:
Vladimir Panteleev wrote:
 I've been working on this project on and off for over a year, and 
 presented it as part of my graduation thesis on memory management in D. 

Sounds great, is it possible to read the aforementioned thesis too ?
 I think I'm done working on it for a while (due to many other projects 
 begging for attention), and even though there's still things that could 
 be finished or improved, it's quite useful as it is now.
 
 Diamond is a post-mortem memory debugger and profiler. It is composed of 
 two parts:
  * a module, which should be imported before any other modules in the 
 project to be debugged
  * a memory log analyzer, which allows inspecting generated memory logs
 
 The module logs all memory operations to a file, as well as periodic 
 memory snapshots (before garbage collects). Some logging options are 
 configurable.
 
 Diamond aims to facilitate debugging memory leaks (data referenced by 
 bogus pointers), memory corruption and other problems. It was written 
 for D1 (both Phobos and Tango), D2 support is untested at best.
 
 Runtime module features:
  * logs all memory events, with timestamps and call stacks
  * exports C functions, allowing debuggee to log memory maps or 
 snapshots at any time, as well as log text comments
  * has optional memory debugging features, like checking free calls and 
 stomping on deallocated memory
 
 Log analyzer features:
  * uses map files to display symbols in call stacks
  * can seek through the log file, allowing to examine the application 
 state at different points in time
  * can display "top allocators" - call stacks that allocated most bytes
  * can filter memory events by address range
  * can display a visual "memory map" [1] (useful for quickly finding 
 large areas the GC shouldn't be scanning for pointers)
  * can search for references (pointers) to a certain memory range
  * can dump a region of memory to screen
 
 Things still to be done:
  * documentation
  * more type information (by hooking higher-level allocators)
  * dumping data segment and thread stacks (currently only the heap is 
 dumped)
  * more runtime library options
 
 Project homepage:
 http://dsource.org/projects/diamond/
 
 [1] 
 http://dump.thecybershadow.net/36ee988fc564aa9ab5529d43662eec81/0000062E.png 
 
 

Jun 22 2009
next sibling parent reply "Vladimir Panteleev" <thecybershadow gmail.com> writes:
On Mon, 22 Jun 2009 10:55:37 +0300, Extrawurst <spam extrawurst.org> wrote:

 Sounds great, is it possible to read the aforementioned thesis too ?

I've been undecided whether I should post it online, for the reason that it was written for a committee of Moldavian professors who had no clue what a garbage collector is (not to mention having heard of D), and were definitely not going to read my thesis (just listen to the 10-minute presentation)... Even though I did put some effort into it, it may have some inaccuracies. So please don't judge it too harshly :P Thesis: http://thecybershadow.net/d/Memory_Management_in_the_D_Programming_Language.pdf Presentation (PowerPoint 2007, sorry): http://thecybershadow.net/d/Presentation.pptx -- Best regards, Vladimir mailto:thecybershadow gmail.com
Jun 27 2009
parent reply Nick B <nick.barbalich gmail.com> writes:
Vladimir Panteleev wrote:
 On Mon, 22 Jun 2009 10:55:37 +0300, Extrawurst <spam extrawurst.org> wrote:
 
 Sounds great, is it possible to read the aforementioned thesis too ?

I've been undecided whether I should post it online, for the reason that it was written for a committee of Moldavian professors who had no clue what a garbage collector is (not to mention having heard of D), and were definitely not going to read my thesis (just listen to the 10-minute presentation)... Even though I did put some effort into it, it may have some inaccuracies. So please don't judge it too harshly :P Thesis: http://thecybershadow.net/d/Memory_Management_in_the_D_Prog amming_Language.pdf Presentation (PowerPoint 2007, sorry): http://thecybershadow.net/d/Presentation.pptx

Vladimir I would just like to thank you posting your thesis. It was an interesting and enjoyable read. regards Nick B.
Jul 03 2009
next sibling parent Extrawurst <spam extrawurst.org> writes:
Nick B wrote:
 Vladimir Panteleev wrote:
 On Mon, 22 Jun 2009 10:55:37 +0300, Extrawurst <spam extrawurst.org> 
 wrote:

 Sounds great, is it possible to read the aforementioned thesis too ?

I've been undecided whether I should post it online, for the reason that it was written for a committee of Moldavian professors who had no clue what a garbage collector is (not to mention having heard of D), and were definitely not going to read my thesis (just listen to the 10-minute presentation)... Even though I did put some effort into it, it may have some inaccuracies. So please don't judge it too harshly :P Thesis: http://thecybershadow.net/d/Memory_Management_in_the_D_Prog amming_Language.pdf Presentation (PowerPoint 2007, sorry): http://thecybershadow.net/d/Presentation.pptx

Vladimir I would just like to thank you posting your thesis. It was an interesting and enjoyable read. regards Nick B.

Thanks from my end too, i am still trying to find the time reading it though ;) Extrawurst
Jul 03 2009
prev sibling parent reply Lutger <lutger.blijdestijn gmail.com> writes:
Vladimir Panteleev wrote:

 On Fri, 03 Jul 2009 12:06:05 +0300, Nick B <nick.barbalich gmail.com>
 wrote:
 
 Vladimir Panteleev wrote:
 On Mon, 22 Jun 2009 10:55:37 +0300, Extrawurst <spam extrawurst.org>
 wrote:

 Sounds great, is it possible to read the aforementioned thesis too ?

that it was written for a committee of Moldavian professors who had no clue what a garbage collector is (not to mention having heard of D), and were definitely not going to read my thesis (just listen to the 10-minute presentation)... Even though I did put some effort into it, it may have some inaccuracies. So please don't judge it too harshly :P Thesis:



   Presentation (PowerPoint 2007, sorry):
 http://thecybershadow.net/d/Presentation.pptx

Vladimir I would just like to thank you posting your thesis. It was an interesting and enjoyable read. regards Nick B.

I'm glad you liked it, I guess my effort didn't go to waste after all :)

Surely not, I'm still reading it too. Don't forget that but a small percentage of readers will actually post feedback!
Jul 05 2009
parent Tim Matthews <tim.matthews7 gmail.com> writes:
Lutger wrote:
 
 Surely not, I'm still reading it too. Don't forget that but a small 
 percentage of readers will actually post feedback!
 

I read it and didn't post feedback but I did think it was actually a great read. If anyone else has a thesis I would be interested in reading those too.
Jul 05 2009
prev sibling parent "Vladimir Panteleev" <thecybershadow gmail.com> writes:
On Fri, 03 Jul 2009 12:06:05 +0300, Nick B <nick.barbalich gmail.com>  
wrote:

 Vladimir Panteleev wrote:
 On Mon, 22 Jun 2009 10:55:37 +0300, Extrawurst <spam extrawurst.org>  
 wrote:

 Sounds great, is it possible to read the aforementioned thesis too ?

that it was written for a committee of Moldavian professors who had no clue what a garbage collector is (not to mention having heard of D), and were definitely not going to read my thesis (just listen to the 10-minute presentation)... Even though I did put some effort into it, it may have some inaccuracies. So please don't judge it too harshly :P Thesis: http://thecybershadow.net/d/Memory_Management_in_the_D_Prog amming_Language.pdf Presentation (PowerPoint 2007, sorry): http://thecybershadow.net/d/Presentation.pptx

Vladimir I would just like to thank you posting your thesis. It was an interesting and enjoyable read. regards Nick B.

I'm glad you liked it, I guess my effort didn't go to waste after all :) -- Best regards, Vladimir mailto:thecybershadow gmail.com
Jul 05 2009