From 508f868c1c3a0b09db14d5765dc12b4c112ca478 Mon Sep 17 00:00:00 2001 From: Mike C Date: Fri, 20 Jan 2017 14:24:41 -0500 Subject: [PATCH] Added ability to adjust heap size -- most useful when using --use-ram argument --- process_maps.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/process_maps.py b/process_maps.py index 08da07c..d6cacc7 100755 --- a/process_maps.py +++ b/process_maps.py @@ -32,6 +32,8 @@ if __name__ == '__main__': help='don\'t sleep between downloads -- WARNING you can easily run into throttling on mirrors if you use this option') parser.add_argument('--use-ram', action='store_true', help='use RAM for mapsforge processing -- WARNING mapsforge uses 10x the map size in RAM for processing (ie. 100Mb map = 1Gb RAM usage), you want a LOT of RAM for this option') + parser.add_argument('--max-heap-space', action='store', default='4g', + help='set the max heap space for the JVM, use standard -Xmx values, default (4g) should be fine if not using --use-ram argument') #TODO: Add argument to pass path to osmosis #TODO: Add argument to pass path to output dir args = parser.parse_args() @@ -72,7 +74,7 @@ if __name__ == '__main__': subprocess.run([bunzip2_cmd, os.path.join(dirpath, file)]) # Setup various runtime aspects (going to do multiple osmosis runs (maps AND POIs) - env['JAVACMD_OPTIONS'] = '-server -Djava.io.tmpdir=' + os.path.join(base_path, 'tmp') # Setup java temp dir to something a bit more sane (tmpfs /tmp for the loss) + env['JAVACMD_OPTIONS'] = '-Xmx' + args.max_heap_space + ' -server -Djava.io.tmpdir=' + os.path.join(base_path, 'tmp') # Setup java temp dir to something a bit more sane (tmpfs /tmp for the loss) files_to_process = [] for dirpath, dirnames, filenames in os.walk('dl'): for file in filenames: