Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Is there support or techniques for finding if my code has a memory leak?

 

I think I remember reading somewhere a long time ago that there are some checks that are, or may be, performed when the program exits. If so what are they?

 

However, being informed you have a memory leak is not much use unless you either additionally have information about the specific instace of leak (i.e. the address of the orphaned cell) or you can narrow down the focus of detection to smaller specific chunks of code. Does anything like this exist?

 

Suppose I have code with 4 functions in it, and I suspect function C has a memory leak, is there any way of doing something like this?

 

FunctionA();

FunctionB();

MARK_START_OF_CHECKING

FunctionC();

CHECK_FOR_LEAKS

FunctionD();

When the app exits, BREW will automatically check if there is any memory leak detected. please take a look at: https://developer.brewmp.com/resources/tech-guides/memory-and-heap-techn...

When the app exits, BREW will automatically check if there is any memory leak detected. please take a look at: https://developer.brewmp.com/resources/tech-guides/memory-and-heap-techn...

Is enabling AEE_DBG_HEAP  expensive in terms of additional memory overhead / performance etc.
Should it be set to 0 before releasing?

Is enabling AEE_DBG_HEAP  expensive in terms of additional memory overhead / performance etc.
Should it be set to 0 before releasing?

Yeah you should undefine it before releasing your code.

Yeah you should undefine it before releasing your code.

Is there a way of automating the checking of a detected leak?
i.e. in order to know there is a leak a person has to watch the output and scan it for leaks, it would be better if the process can be automated so that build/test systems can do it without human intervention.
Is there anyway of doing this, such as being able to halt code execution (force an exception) at the point of exit if a leak is detected, or is it possible to redirect the output to a file so the file can be scanned with a perl script or whatever?

Is there a way of automating the checking of a detected leak?
i.e. in order to know there is a leak a person has to watch the output and scan it for leaks, it would be better if the process can be automated so that build/test systems can do it without human intervention.
Is there anyway of doing this, such as being able to halt code execution (force an exception) at the point of exit if a leak is detected, or is it possible to redirect the output to a file so the file can be scanned with a perl script or whatever?