Issue in ProductIO writing code

Hey!
I’ve noticed a possible issue in the writing code of the ProductIO class.
The code iterates over all bands and fully writes each to disk.
This is okay when all bands are independent, but for GPF operators which implement the computeTileStack method this is not good.
If now the ProductIO requests the data tiles for one band, the data for all bands is requested and put into the cache. It can happen that the data doesn’t fit into the cache and for the next band which shall be written all data must be computed again.
It would be better the writing code would first iterate over the tiles and then write each band tile data.

Also, I noticed that the JAI tile cache is still set to 1GB by default. I think it would be good to increase it.

@diana_harosa @TomBlock

1 Like

Thanks Marco - isn’t computeTileStack used all over the place?

I have also wondered why the tile cache is that small in the current age.

I guess computeTile and computeTileStack are almost equally used.
And the disadvantage only becomes apparent when you have a lot of bands.
And ProductIO is only used when writing from SNAP Desktop. When using GPF the WriteOp is used. This one writes the tiles first.

1 Like

Jira ticket SNAP-3873 created.

1 Like