Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Memory leak on memory analysis using libmalloc_g even without any memory allocation: (2 Items)
   
Memory leak on memory analysis using libmalloc_g even without any memory allocation  
This is probably a stupid problem, but I am new to this topic and couldn't find any solution here yet (6.3.0SP3; target:
 PPC).
I have the following simple C++ dummy application:
int main() {
	int i=0x7000000;
	while (i--);
	return i;
}

Running the Memory Profiling tool results in several memory leaks, although there are obviously no allocations at all. 
I'm using the default configuration for both compiling (debug build) and the Memory Profiling tool. I also copied the 
libmalloc_g.so to the target to ensure it is used properly (otherwise an error message would show up anyway).

Could you please provide me with some basic generic hints, which could possibly avoid this problem?
Thank you!
Re: Memory leak on memory analysis using libmalloc_g even without any memory allocation  
Libc has own memory leaks which is memory allocated at the begging and it is needed during whole program run, and it is 
never released because
there is not much benefit in releasing memory "at exit" in this case. You should see backtrace pointing to system 
addresses compare to
if you add memory leak to your code if will point to your code.

Markus Schmoelzer wrote:
> This is probably a stupid problem, but I am new to this topic and couldn't find any solution here yet (6.3.0SP3; 
target: PPC).
> I have the following simple C++ dummy application:
> int main() {
> 	int i=0x7000000;
> 	while (i--);
> 	return i;
> }
> 
> Running the Memory Profiling tool results in several memory leaks, although there are obviously no allocations at all.
 I'm using the default configuration for both compiling (debug build) and the Memory Profiling tool. I also copied the 
libmalloc_g.so to the target to ensure it is used properly (otherwise an error message would show up anyway).
> 
> Could you please provide me with some basic generic hints, which could possibly avoid this problem?
> Thank you!
> 
> 
> _______________________________________________
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post29134
>