<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>I have been experimenting with the GDAL_HTTP_MULTIRANGE config option added in gdal-2.3.  I have noticed that setting this to YES requires fewer curl requests, but utilizes a more memory compared to SERIAL. From a very simple test (details below):</div><div><br></div><div><div>1. gdal-2.2.4:<br>        Maximum resident set size (kbytes): 45544<br></div><div>2. gdal-2.3.0 with GDAL_HTTP_MULTIRANGE=SERIAL<br>        Maximum resident set size (kbytes): 46120<br></div><div>3. gdal-2.3.0 with GDAL_HTTP_MULTIRANGE=YES</div><div>        Maximum resident set size (kbytes): 83828</div></div><div><br></div><div>The biggest thing I noticed from the log is that multiple HTTP connections are left intact when GDAL_HTTP_MULTIRANGE=YES. I'm guessing this is where the additional memory utilization comes from.  Is there any way to reduce the memory footprint when GDAL_HTTP_MULTIRANGE=YES?</div><div><br></div><div>I came across this while trying to understand why I was seeing a much higher memory footprint with a MapServer built with gdal >= 2.3 compared to MapServer built with gdal <= 2.2.4, detailed here: <a href="https://lists.osgeo.org/pipermail/mapserver-users/2019-April/081121.html">https://lists.osgeo.org/pipermail/mapserver-users/2019-April/081121.html</a></div><div><br></div><div>Thanks,</div><div>Pete</div><div><br></div><div>PS:  Here are my test details.  I ran a test with the following config options:</div><div><br></div><div><div>GDAL_DISABLE_READDIR_ON_OPEN=YES</div><div>CPL_VSIL_CURL_ALLOWED_EXTENSIONS=tif</div><div>GDAL_CACHEMAX=0</div><div>VSI_CACHE=FALSE</div><div>CPL_VSIL_CURL_NON_CACHED="/vsicurl/<a href="https://s3.amazonaws.com">https://s3.amazonaws.com</a>" CPL_CURL_VERBOSE=ON </div><div><br></div><div>and the following command:</div><div>/usr/bin/time -v gdal_translate -outsize 256 256 -projwin_srs EPSG:3857 -projwin 13894417.251632 -1012637.7505811 13895028.747858 -1013249.2468073 /vsicurl/<a href="https://s3.amazonaws.com/pschmitt-test-public/b378087a-c2a5-43a0-abec-71fcfb051150_cog.tif">https://s3.amazonaws.com/pschmitt-test-public/b378087a-c2a5-43a0-abec-71fcfb051150_cog.tif</a> /out.tif | grep "Maximum resident set size"</div></div></div></div></div></div></div></div></div>