[Gdal-dev] Memory problem with ECW images

Fabien Dachicourt support at geoimage.fr
Thu Sep 21 04:50:38 EDT 2006


Hi Tom,
Thanks for your answer,
Actually, i use the library version packaged in FWTools 1.0.5, I don't know 
if it corresponds to the RC2 version :
- NCScnet_fw.dll : 1.0.0.1
- NCSEcw_fw.dll : 3.1.0.350
- NCSUtil_fw.dll : 1.0.0.1

Anyhow, your description corresponds to what i get.
1/4 of physical RAM seems quite big, cause we manage our own cache to manage 
uncompressed blocks. I'm going to try the NCSecwSetConfig function to reduce 
it.

Regards,
Fabien

----- Original Message ----- 
From: "Tom Lynch" <tflynch at gmail.com>
To: "Fabien Dachicourt" <support at geoimage.fr>
Cc: <gdal-dev at lists.maptools.org>
Sent: Thursday, September 21, 2006 3:52 AM
Subject: Re: [Gdal-dev] Memory problem with ECW images


> Hi Fabien,
>
> Which version of the ECW libraries are you using?  If it's the
> previous RC2, there was definitely a memory leak in that distribution,
> relating to tiled views.  That bug was fixed for the current public
> release.
>
> The ECW library maintains a cache for compressed and uncompressed
> blocks of frequently used imagery as views are read.  The basic method
> used is to set cache size at about 1/4 of physical RAM and fill with
> uncompressed blocks as they are viewed, then start to recycle cache
> for compressed blocks as more imagery is viewed, on an LRU basis.  The
> cache is also purged at various times, including on library shutdown.
>
> The maximum size of the cache can be controlled using
> NCSecwSetConfig(NCSCFG_CACHE_MAXMEM, <size in bytes>);
>
> Hope this helps.  If you're seeing a bug in ECW caching please let us
> know, and we'll correspond with you to locate and fix the problem.
>
> Regards
>
> Tom Lynch
>
> On 9/21/06, Fabien Dachicourt <support at geoimage.fr> wrote:
>> Hi,
>> Our software browses large images through GDAL library, it reads images 
>> by
>> blocks at any given resolution with GDALDatasetRasterIO and frees blocks
>> which are out of view. It works pretty fine, it allows to control the 
>> exact
>> amount of data in memory.
>> However we notice some large memory consumption with ECW images, it looks
>> like there is a big memory leak : all loaded tiles are stored somewhere 
>> in
>> memory and never free.
>> Exactly the same RGB image in TIFF format works fine, without memory
>> overflow.
>>
>> Is it a memory leak or any hidden cache in the ECW libraries or in the 
>> ECW
>> driver ? is there any way to control the size of this cache ?
>>
>> The GDAL cache is set to 2MB.
>> The GDAL version is 1.3.2.0 (FWTools 1.0.5).
>>
>> Thanks in advance for any help,
>> Fabien
>>
>>
>> _______________________________________________
>> Gdal-dev mailing list
>> Gdal-dev at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/gdal-dev
>>
>
>
> -- 
> Tom Lynch
> Development, ER Mapper
> Phone:      +61 8 93882900
> Fax:        +61 8 93882901
> Email:      tom.lynch at ermapper.com
> Web:        http://www.ermapper.com
> Forums:     http://forum.ermapper.com
> 





More information about the Gdal-dev mailing list