digitalmars.D.learn - valgrind
- simendsjo (5/5) Mar 10 2013 I haven't used valgrind/cachegrind on C/C++ programs before, but
- simendsjo (2/7) Mar 10 2013 Ah, nevermind. Just found "callgrind"..
- Druzhinin Alexandr (6/12) Mar 10 2013 Why are you pretty sure? The difference is garbage collector only that
- simendsjo (5/22) Mar 10 2013 My "pretty sure" was referring to the fact that the callgraph
- Dmitry Olshansky (5/9) Mar 10 2013 I've used it just yesterday with great success. At least callgrind and
- Druzhinin Alexandr (13/20) Mar 10 2013 Dmitry, using massif I get tree like this (there are normal informative
- Dmitry Olshansky (31/53) Mar 10 2013 Here is what I see when I run it on optimized binary compiled with ldc:
- Druzhinin Alexandr (5/27) Mar 10 2013 Thanks for answer, Dmitry! My Mr.X was opengl driver - I just checked my...
- Dmitry Olshansky (4/37) Mar 11 2013 I think it's deceptively called massif-visualizer :)
- Druzhinin Alexandr (2/7) Mar 11 2013 very, very amazing and so unexpected! :)
- Brian Schott (4/9) Mar 11 2013 If you're on Linux I'd recommend that you also look at Perf[1],
- Druzhinin Alexandr (2/10) Mar 11 2013 Thanks for link!
I haven't used valgrind/cachegrind on C/C++ programs before, but I'm pretty sure it doesn't behave as expected on D code. I found this page to fix the mangling issue: http://wiki.dlang.org/Other_Dev_Tools, but all callgraphs is empty.
Mar 10 2013
On Sunday, 10 March 2013 at 11:06:41 UTC, simendsjo wrote:I haven't used valgrind/cachegrind on C/C++ programs before, but I'm pretty sure it doesn't behave as expected on D code. I found this page to fix the mangling issue: http://wiki.dlang.org/Other_Dev_Tools, but all callgraphs is empty.Ah, nevermind. Just found "callgrind"..
Mar 10 2013
On 10.03.2013 18:11, simendsjo wrote:On Sunday, 10 March 2013 at 11:06:41 UTC, simendsjo wrote:Why are you pretty sure? The difference is garbage collector only that scans memory and causes wrong read from valgrind POV and mangling makes work with it harder a little bit. But profiling, heap usage and memory leaks are the same I'm sure . I use it recently but I found one bug and it was simple and clear - I mean bug finding.I haven't used valgrind/cachegrind on C/C++ programs before, but I'm pretty sure it doesn't behave as expected on D code. I found this page to fix the mangling issue: http://wiki.dlang.org/Other_Dev_Tools, but all callgraphs is empty.Ah, nevermind. Just found "callgrind"..
Mar 10 2013
On Sunday, 10 March 2013 at 11:58:39 UTC, Druzhinin Alexandr wrote:On 10.03.2013 18:11, simendsjo wrote:My "pretty sure" was referring to the fact that the callgraph only printed the function I was looking at. As I said, "--tool=callgrind" was the option I was looking for.On Sunday, 10 March 2013 at 11:06:41 UTC, simendsjo wrote:Why are you pretty sure? The difference is garbage collector only that scans memory and causes wrong read from valgrind POV and mangling makes work with it harder a little bit. But profiling, heap usage and memory leaks are the same I'm sure . I use it recently but I found one bug and it was simple and clear - I mean bug finding.I haven't used valgrind/cachegrind on C/C++ programs before, but I'm pretty sure it doesn't behave as expected on D code. I found this page to fix the mangling issue: http://wiki.dlang.org/Other_Dev_Tools, but all callgraphs is empty.Ah, nevermind. Just found "callgrind"..
Mar 10 2013
10-Mar-2013 15:06, simendsjo пишет:I haven't used valgrind/cachegrind on C/C++ programs before, but I'm pretty sure it doesn't behave as expected on D code. I found this page to fix the mangling issue: http://wiki.dlang.org/Other_Dev_Tools, but all callgraphs is empty.I've used it just yesterday with great success. At least callgrind and massif definitely work. -- Dmitry Olshansky
Mar 10 2013
On 10.03.2013 19:45, Dmitry Olshansky wrote:10-Mar-2013 15:06, simendsjo пишет:Dmitry, using massif I get tree like this (there are normal informative branches too, of course): | ->26.85% (10,364,525B) 0xD418247: ??? | ->09.86% (3,807,325B) 0x1442E08E: ??? | | ->02.99% (1,155,831B) 0x145188A6: ??? | | | ->02.99% (1,155,831B) 0x3E: ??? | | | ->02.99% (1,155,831B) 0xEB70BC7: ??? | | | ->02.99% (1,155,831B) 0x145187CE: ??? | | | ->02.99% (1,155,831B) 0x145188A6: ??? how to know who the hell is used my memory? who is Mr. '???'? can building phobos and druntime help with it?I haven't used valgrind/cachegrind on C/C++ programs before, but I'm pretty sure it doesn't behave as expected on D code. I found this page to fix the mangling issue: http://wiki.dlang.org/Other_Dev_Tools, but all callgraphs is empty.I've used it just yesterday with great success. At least callgrind and massif definitely work.
Mar 10 2013
10-Mar-2013 17:04, Druzhinin Alexandr пишет:On 10.03.2013 19:45, Dmitry Olshansky wrote:Here is what I see when I run it on optimized binary compiled with ldc: http://sdrv.ms/ZrFgh9 Same compiled with gdc: http://sdrv.ms/12FPPF3 And dmd also optimized: http://sdrv.ms/15Gj7RF And it looks good. I didn't bother to check the text dump in depth but here is one slice: n6: 41816 (heap allocation functions) malloc/new/new[], --alloc-fns, etc. n1: 8208 0x540209: _D2gc3gcx4Pool10initializeMFmbZv (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53EBEB: _D2gc3gcx3Gcx7newPoolMFmbZPS2gc3gcx4Pool (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53C33B: _D2gc3gcx2GC12mallocNoSyncMFmkPmZPv (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53C1F1: _D2gc3gcx2GC6mallocMFmkPmZPv (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x51CABB: gc_malloc (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x51E7A6: _d_newclass (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x545123: thread_attachThis (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x5450B5: thread_init (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53B72B: gc_init (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x51E710: _ .... So I guess your Mr. X is D's GC that reserves about 1Mb at start. -- Dmitry Olshansky10-Mar-2013 15:06, simendsjo пишет:Dmitry, using massif I get tree like this (there are normal informative branches too, of course): | ->26.85% (10,364,525B) 0xD418247: ??? | ->09.86% (3,807,325B) 0x1442E08E: ??? | | ->02.99% (1,155,831B) 0x145188A6: ??? | | | ->02.99% (1,155,831B) 0x3E: ??? | | | ->02.99% (1,155,831B) 0xEB70BC7: ??? | | | ->02.99% (1,155,831B) 0x145187CE: ??? | | | ->02.99% (1,155,831B) 0x145188A6: ??? how to know who the hell is used my memory? who is Mr. '???'? can building phobos and druntime help with it?I haven't used valgrind/cachegrind on C/C++ programs before, but I'm pretty sure it doesn't behave as expected on D code. I found this page to fix the mangling issue: http://wiki.dlang.org/Other_Dev_Tools, but all callgraphs is empty.I've used it just yesterday with great success. At least callgrind and massif definitely work.
Mar 10 2013
On 11.03.2013 02:32, Dmitry Olshansky wrote:I didn't bother to check the text dump in depth but here is one slice: n6: 41816 (heap allocation functions) malloc/new/new[], --alloc-fns, etc. n1: 8208 0x540209: _D2gc3gcx4Pool10initializeMFmbZv (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53EBEB: _D2gc3gcx3Gcx7newPoolMFmbZPS2gc3gcx4Pool (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53C33B: _D2gc3gcx2GC12mallocNoSyncMFmkPmZPv (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53C1F1: _D2gc3gcx2GC6mallocMFmkPmZPv (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x51CABB: gc_malloc (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x51E7A6: _d_newclass (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x545123: thread_attachThis (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x5450B5: thread_init (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53B72B: gc_init (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x51E710: _ .... So I guess your Mr. X is D's GC that reserves about 1Mb at start.Thanks for answer, Dmitry! My Mr.X was opengl driver - I just checked my code that using 3rd libs without debug symbols and found who it was. Massif shows me gc the same way as you, I just didn't show it. What visualizer do you use?
Mar 10 2013
11-Mar-2013 04:43, Druzhinin Alexandr пишет:On 11.03.2013 02:32, Dmitry Olshansky wrote:I think it's deceptively called massif-visualizer :) -- Dmitry OlshanskyI didn't bother to check the text dump in depth but here is one slice: n6: 41816 (heap allocation functions) malloc/new/new[], --alloc-fns, etc. n1: 8208 0x540209: _D2gc3gcx4Pool10initializeMFmbZv (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53EBEB: _D2gc3gcx3Gcx7newPoolMFmbZPS2gc3gcx4Pool (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53C33B: _D2gc3gcx2GC12mallocNoSyncMFmkPmZPv (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53C1F1: _D2gc3gcx2GC6mallocMFmkPmZPv (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x51CABB: gc_malloc (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x51E7A6: _d_newclass (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x545123: thread_attachThis (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x5450B5: thread_init (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x53B72B: gc_init (in /home/dmitry/Dscanner/dscanner-dmd) n1: 8208 0x51E710: _ .... So I guess your Mr. X is D's GC that reserves about 1Mb at start.Thanks for answer, Dmitry! My Mr.X was opengl driver - I just checked my code that using 3rd libs without debug symbols and found who it was. Massif shows me gc the same way as you, I just didn't show it. What visualizer do you use?
Mar 11 2013
On 12.03.2013 01:28, Dmitry Olshansky wrote:very, very amazing and so unexpected! :)Thanks for answer, Dmitry! My Mr.X was opengl driver - I just checked my code that using 3rd libs without debug symbols and found who it was. Massif shows me gc the same way as you, I just didn't show it. What visualizer do you use?I think it's deceptively called massif-visualizer :)
Mar 11 2013
On Sunday, 10 March 2013 at 11:06:41 UTC, simendsjo wrote:I haven't used valgrind/cachegrind on C/C++ programs before, but I'm pretty sure it doesn't behave as expected on D code. I found this page to fix the mangling issue: http://wiki.dlang.org/Other_Dev_Tools, but all callgraphs is empty.If you're on Linux I'd recommend that you also look at Perf[1], as Valgrind is sometimes wrong about where your code is slow. [1] https://perf.wiki.kernel.org/index.php/Tutorial
Mar 11 2013
On 12.03.2013 01:39, Brian Schott wrote:On Sunday, 10 March 2013 at 11:06:41 UTC, simendsjo wrote:Thanks for link!I haven't used valgrind/cachegrind on C/C++ programs before, but I'm pretty sure it doesn't behave as expected on D code. I found this page to fix the mangling issue: http://wiki.dlang.org/Other_Dev_Tools, but all callgraphs is empty.If you're on Linux I'd recommend that you also look at Perf[1], as Valgrind is sometimes wrong about where your code is slow. [1] https://perf.wiki.kernel.org/index.php/Tutorial
Mar 11 2013