Opened 14 years ago

Closed 14 years ago

Last modified 14 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 14 years ago.

Download all attachments as: .zip

Change History (5)

by Even Rouault, 14 years ago

Attachment: cache64.patch added

comment:1 by warmerdam, 14 years ago

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

comment:2 by Even Rouault, 14 years ago

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 by Even Rouault, 14 years ago

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 by Even Rouault, 14 years ago

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.