[Gdal-dev] Memory leak under Matlab (a follow up from - importFromWkt() problem)

Joaquim Luis jluis at ualg.pt
Sun Sep 3 18:34:16 EDT 2006


Hi,
I was following this thread with a particular interest due to another 
problem.
I wrote a OGR based Matlab MEX file to do coordinate conversions.
Well the thing works well but has a small memory leak. Though small, the 
leak
is sufficiently important to prevent the use of that program when 
attached to mouse
movements (it accumulates fast).

Now given the valgrind report about the test prog "importwkt" I 
converted it into a ML
mex and, ... the memory leak is still there.
To be honest a similar story happened with a GMT based mex file to do 
also coordinate
conversions, so I'm starting to lean to the probability that the problem 
might be on the Matlab
side (a third attempt with a OpenCV mex also reveals some memory leak) .

However, guessing that it wont be nothing at all easy to convince 
Mathworks about this problem
I'm asking here about the chances that it might be a GDAL memory leak.

Thanks

Joaquim Luis

> Now, what valgrind says about it (see LEAK SUMMARY):
>
> ==6766==
> ==6766== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 75 from 1)
> ==6766== malloc/free: in use at exit: 3,723 bytes in 43 blocks.
> ==6766== malloc/free: 230,162 allocs, 230,119 frees, 10,970,713 bytes
> allocated.
> ==6766== For counts of detected errors, rerun with: -v
> ==6766== searching for pointers to 43 not-freed blocks.
> ==6766== checked 2,427,092 bytes.
> ==6766==
> ==6766== LEAK SUMMARY:
> ==6766==    definitely lost: 0 bytes in 0 blocks.
> ==6766==      possibly lost: 0 bytes in 0 blocks.
> ==6766==    still reachable: 3,723 bytes in 43 blocks.
> ==6766==         suppressed: 0 bytes in 0 blocks.
> ==6766== Reachable blocks (those to which a pointer was found) are no




More information about the Gdal-dev mailing list