[gdal-dev] Memory usage for GetProjectionRef

Frank Warmerdam warmerdam at pobox.com
Tue Oct 5 18:36:05 EDT 2010


Livneh Yehiyam wrote:
> Hi I'm sorry if I was misunderstood, but these are not leaks I'm worried
> about, but rather I'm trying to understand the memory consumption of the
> various GDAL calls I use. I didn't notice any leak, and I trust you test for
> leaks all the time. 

Livney,

We don't check for memory leaks all the time or comprehensively.  But
regular use of GeoTIFF it one of the most frequently leak tested things.

> Take for example the first two examples below. These two
> are the same image, with and without the pyramid (overviews). Why should the
> call to GetProjectionRef raise the memory of the application by a different
> amount?

In the case of pyramids at the end of Open the "last directory" which is
likely the top level of the pyramid will be the active directory.  Calling
GetProjectionRef() causes a switch of context back to the base pyramid level
to fetch the projection tags.   The base directory is typically larger
since it will have the projection, other metadata and bigger tile
offset/size arrays.

If these aren't leaks and the amounts of memory are modest why does it
matter what details are happening internally?  The behavior of the
GeoTIFF driver is fairly complex for some good, and some bad reasons.
Trying to understand the details of it's operation - especially by
observing memory use - is likely to be frustrating.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list