Skip to content

Commit

Permalink
Update cache calculation in gdal2tiles.py
Browse files Browse the repository at this point in the history
See #2020
  • Loading branch information
EvertEt authored and rouault committed Nov 15, 2019
1 parent f80e9b8 commit eec2ce0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gdal/swig/python/scripts/gdal2tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -2867,8 +2867,8 @@ def single_threaded_tiling(input_file, output_folder, options):
def multi_threaded_tiling(input_file, output_folder, options):
nb_processes = options.nb_processes or 1

# Make sure that all processes do not consume more than GDAL_CACHEMAX
os.environ['GDAL_CACHEMAX'] = '%d' % int(gdal.GetCacheMax() / nb_processes)
# Make sure that all processes do not consume more than `gdal.GetCacheMax()`
os.environ['GDAL_CACHEMAX'] = '%d' % max(1, int(gdal.GetCacheMax() / 1024 / 1024 / nb_processes))

(conf_receiver, conf_sender) = Pipe(False)

Expand Down

0 comments on commit eec2ce0

Please sign in to comment.