Opened 11 years ago

Closed 11 years ago

#5020 closed defect (fixed)

GDALSuggestedWarpOutput uses too much memory on large images

Reported by: warmerdam Owned by: GDALSuggestedWarpOutput2
Priority: normal Milestone: 1.10.0
Component: Algorithms Version: unspecified
Severity: normal Keywords: GDALSuggestedWarpOutput
Cc:

Description

I have discovered that in GDAL 1.9 if you invoke GDALSuggestedWarpOutput() on an image that is large (say 1000000 by 1000000) then the working grid is allocated very large (at 1/50 resolution in both directions) - so several GB.

The memory use is an issue, but if the estimation needs to use grid oriented rather than edge oriented it also would presumably do way too much work.

This code is the issue:

#define N_PIXELSTEP 50
    int nSteps = (int) (double(MIN(nInYSize, nInXSize)) / N_PIXELSTEP + .5);
    if (nSteps < 20)
        nSteps = 20;

Change History (1)

comment:1 by warmerdam, 11 years ago

Keywords: GDALSuggestedWarpOutput added
Milestone: 1.10.0
Resolution: fixed
Status: newclosed

Fixed in trunk (r25707) and 1.9 (r25706) to limit each dimension to 100.

Note: See TracTickets for help on using tickets.