Long data processing time for bigger AOI

Dear SNAP community,

I’m trying to prepare input data for the MintPy library, based on snappy. When my script tries to save the processing result, it takes a very very long time (>16h). One of the processing steps is a subset function that cuts the result by a polygon (size ~20x20 km).
Recently, I replaced the WriteIO function with GPF.WriteOp: but it still takes too much time.

There are all the processing steps in the product name:
Subset_S1A_IW_SLC__1SDV_20220120T163529_20220120T163556_041547_04F0E9_5A7F_Orb_Stack_Ifg_Deb_DInSAR_ML_Flt_TC

Do you have any suggestion what can I improve?
I checked code flow in case of much smaller AOI (~3x4 km) and it worked, so I guess there are not any errors in step parameters configuration.

From terminal:

INFO:SNAP:Function write started at 2022-11-30T08:06:56.846460
(6 HOURS AGO).
INFO: org.esa.snap.core.gpf.common.WriteOp: Start writing product Subset_S1A_IW_SLC__1SDV_20220120T163529_20220120T163556_041547_04F0E9_5A7F_Orb_Stack_Ifg_Deb_DInSAR_ML_Flt_TC to ./big_interferograms/20220108_20220120/20220108_20220120_Phase_tc
Writing…, started
Writing…, 13% worked
INFO: org.hsqldb.persist.Logger: Database closed
[reconnecting terminal]
[Reconnection succeeded]
Writing…, 30% worked
Writing…, 40% worked

def write(product, filename, write_format = 'BEAM-DIMAP'):
    WriteOp = jpy.get_type('org.esa.snap.core.gpf.common.WriteOp')
    writeOp = WriteOp(product, File(filename), write_format)
    writeOp.writeProduct(pm)

Hi tanajewski,

it can help to increase the memory. You haven’t said how much RAM is available on your system.

here it is explained how you can increase the amount of memory in general.
https://senbox.atlassian.net/wiki/spaces/SNAP/pages/1898053693/SNAP+FAQs#How-to-increase-memory-for-snappy%3F

In addition, you can increase the size of the cache. The value should be lower as the value for the general memory. Not more than 50% if it.
To change the cache size, you can either go to the performance tab in the SNAP Options and change the value there.

Or you open the snap.properties file (admin mode) in the etc folder of the SNAP installation directory.
Change the value for here:

snap.jai.tileCacheSize=1024

A value of 3000 to 4000 might be a good choice.