Skip to content

Commit

Permalink
Update cache calculation in gdal2tiles.py
Browse files Browse the repository at this point in the history
  • Loading branch information
EvertEt authored Nov 15, 2019
1 parent 1552310 commit 4f84579
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 @@ -2883,8 +2883,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))

pool = Pool(processes=nb_processes)

Expand Down

0 comments on commit 4f84579

Please sign in to comment.