'LargeScaleMeanShift' has failed with a return status -1

I’ve got this error message when trying to process some Worldview optical imagery.

‘LargeScaleMeanShift’ has failed with a return status -1. Please refer to ‘LargeScaleMeanShift’ documentation and check log tab

In the log tab I have the following message at the end of the log.

2021-11-20 22:54:46 (FATAL) LargeScaleMeanShift: Failed to allocate memory for image.

Any idea what the issue is? Is my laptop running out of memory?

Can anyone tell me what is going on here? Basically the available memory is less the the estimated memory. Am i correct in assuming one of the steps requires 976.09GB of memory!?

2021-11-21 10:25:32 (INFO): File PLOT_A_SEG_20_60_5_16_18_FINAL.tif will be written in 1 blocks of 78x500 pixels
2021-11-21 10:25:32 (INFO): Estimated memory for full processing: 0.222862MB (avail.: 256 MB), optimal image partitioning: 1 blocks
2021-11-21 10:25:32 (INFO): File PLOT_A_SEG_20_60_5_17_18_FINAL.tif will be written in 1 blocks of 78x283 pixels
2021-11-21 10:25:35 (INFO): Estimated memory for full processing: 976090MB (avail.: 256 MB), optimal image partitioning: 3813 blocks
2021-11-21 10:25:35 (INFO): File C:/Filepath/PLOT_A_SEG_20_60_5.shp_labelmap.tif will be written in 2484 blocks of 256x128 pixels
2021-11-21 10:25:57 (INFO): Estimated memory for full processing: 7603.54MB (avail.: 256 MB), optimal image partitioning: 30 blocks
2021-11-21 10:25:57 (INFO): Estimation will be performed in 36 blocks of 1664x1664 pixels


what parameters are you using in this application ?

This application is actually a combination of several applications. To find out what is going wrong, perhaps you could try to run these applications individually, as described here


Hello Cedric. Thanks for responding. I used the following parameters

Spatial radius: 20
Range Radius: 60
Minimum Segment Size: 5

Do you know what is going on here? I don’t understand the text. Does it mean more memory (976090MB) is required than I actually have (256MB)


I tried to run the application on big images, and also ran into error.

After running each step of the LSMS workflow workflow, it looks like step 3 and 4 both have a huge memory consumption when dealing with a large number of segments. I need to look at the code in depth to find out what’s happening.

As an alternative you could try to use the Segmentation application instead, using the meanshift algorithm, and the vector mode (the raster mode does not handle big image). Note that the results will differ from what LargeScaleMeanShift would produce. In this case the input image is divided and segmented in tiles, instead of doing the segmentation on the whole image. And then there is a stitching optional step that tries to merge polygons that might have been split due to the tiling process based on distance between the mean radiometry of the segments.

Hope that helps

1 Like

Great thanks Cedric. Thanks for looking into this and finding the issue.

I’ll give your segmentation suggestion a go.