Memory outage killing processing

I’m running ODM on MacOS X Mojave via Docker, processing imagery shot with DroneDeploy on a Mavic Pro. The imagery is stored on an external hard drive. No problems with smaller datasets but with 100+ images I’m running into what I suspect are memory outages (I get a ‘hard drive space critically low’ message from the OS at the same time).

Is it possible to use a directory on the external hard drive as the temporary storage location while processing, rather than /tmp/?

I’m running the following Terminal command from the external hard drive directory in question:

docker run -it --rm -v "$(pwd)/images:/code/images" -v "$(pwd)/odm_orthophoto:/code/odm_orthophoto" -v "$(pwd)/odm_georeferencing:/code/odm_georeferencing" -v "$(pwd)/odm_dem:/code/odm_dem" opendronemap/opendronemap --dtm --dsm

And here’s the (snipped) verbose terminal output. Thanks in advance!

Toms-MBP:A tomallen$ docker run -it --rm -v "$(pwd)/images:/code/images" -v     "$(pwd)/odm_orthophoto:/code/odm_orthophoto" -v "$(pwd)/odm_georeferencing:/code/odm_georeferencing" -v "$(pwd)/odm_dem:/code/odm_dem" opendronemap/opendronemap --dtm --dsm
[INFO]    DTM is turned on, automatically turning on point cloud classification
[INFO]    Initializing OpenDroneMap app - Fri Jun 28 03:09:43  2019
[INFO]    Running ODM Load Dataset Cell
[DEBUG]   Loading dataset from: /code/images
[DEBUG]   /code/images
[DEBUG]   Loaded DJI_0601.JPG | camera: dji fc220 | dimensions: 4000 x 3000 | focal: 4.7 | ccd: 6.17 | lat: 39.4265582778 | lon: 46.3180013056 | alt: 1278.104
[DEBUG]   Loaded DJI_0602.JPG | camera: dji fc220 | dimensions: 4000 x 3000 | focal: 4.7 | ccd: 6.17 | lat: 39.43243025 | lon: 46.3319388611 | alt: 1377.667
[DEBUG]   Loaded DJI_0603.JPG | camera: dji fc220 | dimensions: 4000 x 3000 | focal: 4.7 | ccd: 6.17 | lat: 39.4323949722 | lon: 46.3316619167 | alt: 1377.867
[DEBUG]   Loaded DJI_0604.JPG | camera: dji fc220 | dimensions: 4000 x 3000 | focal: 4.7 | ccd: 6.17 | lat: 39.4323656389 | lon: 46.3314445556 | alt: 1377.967

2019-06-28 03:59:38,920 DEBUG: Undistorting image DJI_0629.JPG
2019-06-28 03:59:38,924 DEBUG: Undistorting image DJI_0646.JPG
2019-06-28 03:59:38,951 DEBUG: Undistorting image DJI_0646.JPG
2019-06-28 03:59:38,954 DEBUG: Undistorting image DJI_0646.JPG
[DEBUG]   running PYTHONPATH=/code/SuperBuild/install/lib/python2.7/dist-packages /code/SuperBuild/src/opensfm/bin/export_bundler /code/opensfm
[DEBUG]   running PYTHONPATH=/code/SuperBuild/install/lib/python2.7/dist-packages /code/SuperBuild/src/opensfm/bin/opensfm export_geocoords /code/opensfm --transformation --proj '+units=m +no_defs=True +datum=WGS84 +proj=utm +zone=38 '
[INFO]    Running ODM OpenSfM Cell - Finished
[INFO]    Running SMVS Cell
[DEBUG]   running /code/SuperBuild/src/elibs/mve/apps/makescene/makescene /code/opensfm/mve /code/smvs
MVE Makescene (built on Nov 29 2018, 13:57:24)
Info: Detected Noah bundler format.
Reading Bundler file (100 cameras, 150316 features)...
Recognized 100 original images from Noah's Bundler.
Creating output directories...
Saving bundle file...
Writing bundle (100 cameras, 150316 features): /code/smvs/synth_0.out...
Processing view view_0000.mve...
  Skipping view_0000.mve: Invalid camera.
Processing view view_0001.mve...
Processing view view_0002.mve...

Processing view view_0096.mve...
Processing view view_0097.mve...
Processing view view_0098.mve...
Processing view view_0099.mve...

Created 100 views with 99 valid cameras.
Imported 99 undistorted images.
[DEBUG]   running /code/SuperBuild/src/elibs/smvs/app/smvsrecon -t2 -a1.0 --max-pixels=409600 -o1 --debug-lvl=0    /code/smvs
Shading-aware Multi-view Stereo (built on Nov 29 2018, 14:22:31)

Initializing scene with 99 views...
Initialized 99 views (max ID is 99), took 25ms.
Reading Photosynther file (100 cameras, 150316 features)...
Automatic input scale: 3
Input embedding: undist-L3
Output embedding: smvs-B3
Running view selection for 99 views...  done, took 34.179s.
Resizing input images for 99 views... Killed
Traceback (most recent call last):
  File "/code/run.py", line 47, in <module>
    plasm.execute(niter=1)
  File "/code/scripts/smvs.py", line 85, in process
    system.run('%s %s %s' % (context.smvs_path, ' '.join(config), tree.smvs))
  File "/code/opendm/system.py", line 34, in run
    raise Exception("Child returned {}".format(retcode))
Exception: Child returned 137

Don’t know much about Macs but since they’re Unix based you could try to create a symlink to your drive. Try something like this:

mkdir /yourdrive/tmp
mv /tmp /tmp-old
ln -s /yourdrive/tmp /tmp