Resample all bands of an L2A image

Hi all,
After the sen2cor transformation I need to create a GeoTiff from a L2A image, resampling all the bands at 10m.
I wrote this python code:

from snappy import ProductIO
from snappy import jpy
from snappy import GPF

p = ProductIO.readProduct('S2A_USER_...T101020.xml') #path of the xml file

GPF.getDefaultInstance().getOperatorSpiRegistry().loadOperatorSpis()
HashMap = jpy.get_type('java.util.HashMap')

parameters = HashMap()
parameters.put('targetResolution', 10)
product=GPF.createProduct('Resample', parameters, p)
ProductIO.writeProduct(product, 'prova12.tif', "GeoTIFF-BigTIFF") #this is line 41

I get this error, while the process is working

SEVERE: org.esa.snap.core.gpf.internal.OperatorSpiRegistryImpl: org.esa.s1tbx.in
sar.gpf.OffsetTrackingOp$Spi:Offset-Tracking conflicts with org.esa.s1tbx.insar.
gpf.coregistration.OffsetTrackingOp$Spi:Offset-Tracking

And, after some minutes, the process end with this error:

Traceback (most recent call last):
  File "py_test.py", line 41, in <module>
RuntimeError: java.lang.RuntimeException: Cannot construct DataBuffer.

Could please someone help me about this?
I have set Java system Xmx parameter to 20GB, so I don’t think is a memory leak.

Thanks in advance!

Have you done the memory setting as it is told in this post?

The “conflicts”-message us actually not an error. It is just to verbose here.

Yes, I tried to use

java_max_mem: 20G

but it gave me the same error.

If this is not the problem, maybe it is the tile cache size.
Please change the value of snap.jai.tileCacheSize in snap.properties.
It is located in the etc folder of your SNAP installation directory. You can set it to 5000 for example.

I got the same error also with this parameter
snap.jai.tileCacheSize = 5000
and this
snap.jai.tileCacheSize = 10000
:frowning:

Have you tried a different output format, like BEAM-DIMAP or NetCDF4?

I tried with BEAM-DIMAP and I got another error too, but I need a GeoTiff.

Now, I had to do another process using GDAL libraries.

Thanks for your help.