[Gdal-dev] GDALRasterBand overhead

Frank Warmerdam warmerdam at pobox.com
Mon Aug 21 15:28:05 EDT 2006


Matt Hanson wrote:
> I was wondering how much overhead is used by the GDALRasterBand object.
> I'd like to know practically how many RasterBands I can have open at one
> time or perhaps there are other issues with opening up multiple bands?
> Should i be concerned with keeping the open bands to a minimum?
> 
> Thanks in advance !

Matt,

It looks like the core GDALRasterBand object is 84bytes.  If you populate
it with metadata, colortables, and so forth it will be correspondingly bigger.

The biggest issue is that if you have done anything to access raster data
on the band, the "block cache" will have been initialized.  And that is
another 4 bytes per block (except for very large files which use a two
layer block cache to reduce memory use in common situations).

Generally speaking band objects don't have file handles associated or other
expensive system objects so you are likely ok to have lots of band objects,
as long as they aren't going to have large instantiated block caches.

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    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list