www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Debugging memory leaks

reply Hipreme <msnmancini hotmail.com> writes:
I want to know if there is some way to debug memory leaks in 
runtime.

I have been dealing with that by using a profiler and checking D 
runtime function calls. Usually those which allocates has high 
cpu usage so it can be easy for those bigger ones. While for the 
smaller ones, this approach doesn't seem to work and looking into 
my task manager I can see it increasing the memory usage very 
slowly.

I wanted to know if there is an option to do that on RUNTIME. 
--vgc is not a good option as I don't care about allocations that 
happens on initialization code.
Feb 15 2023
next sibling parent ryuukk_ <ryuukk.dev gmail.com> writes:
On Wednesday, 15 February 2023 at 18:21:34 UTC, Hipreme wrote:
 I want to know if there is some way to debug memory leaks in 
 runtime.

 I have been dealing with that by using a profiler and checking 
 D runtime function calls. Usually those which allocates has 
 high cpu usage so it can be easy for those bigger ones. While 
 for the smaller ones, this approach doesn't seem to work and 
 looking into my task manager I can see it increasing the memory 
 usage very slowly.

 I wanted to know if there is an option to do that on RUNTIME. 
 --vgc is not a good option as I don't care about allocations 
 that happens on initialization code.
Try with visual studio heap profiler Do you have a sample project that reproduces the leak?
Feb 17 2023
prev sibling parent Guillaume Piolat <first.last spam.org> writes:
On Wednesday, 15 February 2023 at 18:21:34 UTC, Hipreme wrote:
 I want to know if there is some way to debug memory leaks in 
 runtime.

 I have been dealing with that by using a profiler and checking 
 D runtime function calls. Usually those which allocates has 
 high cpu usage so it can be easy for those bigger ones. While 
 for the smaller ones, this approach doesn't seem to work and 
 looking into my task manager I can see it increasing the memory 
 usage very slowly.

 I wanted to know if there is an option to do that on RUNTIME. 
 --vgc is not a good option as I don't care about allocations 
 that happens on initialization code.
Hello, As of a few years, Intel Inspector is free: https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#inspector
Feb 19 2023