Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3689 closed enhancement (fixed)

[PATH] Allow using more than 2GB for GDAL cache

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.8.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: gdal cache
Cc: warmerdam

Description (last modified by Even Rouault)

The attached patch changes the internal type of the max cache size to GIntBig to allow more than 2GB for GDAL cache. It introduces the GDALSetCacheMax64(), GDALGetCacheMax64() and GDALGetCacheUsed64() API. Old 32 bit API are preserved for backward compatibility. Old 32 bit API warn the user if they must be truncated the returned value (GetCacheMax?() and GetCacheUsed?()).

On 32bit builds of GDAL, GDALSetCacheMax64() will *NOT* warn if the user tries to pass a value greater than the maximum amount of memory that can be addressed. (This is a change w.r.t. the initial implementation since 32bit OS depending on their configuration can allow a process to allocate between 2 and 4 GB)

Attachments (1)

cache64.patch (10.6 KB) - added by Even Rouault 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by Even Rouault

Attachment: cache64.patch added

comment:1 Changed 9 years ago by warmerdam

I'm ok with this. Any reason for introducing a new string to bigint function when we already have CPLScanUIntBig?

comment:2 Changed 9 years ago by Even Rouault

Resolution: fixed
Status: newclosed

no serious reason in fact, apart the fact I disliked to have to pass the length of the string... Anyway, I dropped the CPLAtoi64() in favour of CPLScanUIntBig()

Commited in trunk in r20091

comment:3 Changed 9 years ago by Even Rouault

r20093 /trunk/gdal/swig/ (4 files in 4 dirs): Python bindings : map gdal.GetCacheMax?(), gdal.SetCacheMax?() and gdal.GetCacheUsed?() to the corresponding 64bit new API

comment:4 Changed 9 years ago by Even Rouault

Description: modified (diff)

r20095 /trunk/gdal/gcore/gdalrasterblock.cpp: GDALSetCacheMax64() / GDALGetCacheMax64() : remove the restriction to 2GB on 32bit OS. Some configuration of Linux and Windows allow a value between 2GB and 4GB. It is up to the user to specify a sensible value (#3689)

Note: See TracTickets for help on using tickets.