-ram parameter not improving speed in MeanShift

I’m surprised that adding a -ram 10240 does not seem to have effect vs. the default of 256:

$ otbcli_MeanShiftSmoothing -in ROI_7.tif -fout ROI_7_r5_s100.tif uint8 -foutpos filtered_spat.tif -ranger 5 -spatialr 100 -maxiter 100 -modesearch 0 -ram 10240
The processing info indicates:

2021-06-10 21:06:06 (INFO): Estimated memory for full processing: 4835.6MB (avail.: 6000 MB), optimal image partitioning: 1 blocks

Beyond whether the radius of 100 makes sense, why is the increased ram being of no benefit?


RAM is not what will have the more impact on the processing time. At the end of the day, the same number of pixels is processed and written on the disk, which is where most of the time is spent.

Increasing the RAM will reduce the number of required streaming blocks (down to one block in your example, where everything is loaded in the RAM). It might results in some performance gains (less calls to rasterIO, less C++ objects to create), but probably small in comparison with the pixel processing time.

What will have the most impact on processing time is probably the CPU, and possibly the hard drive (IO time)