I have developed a Java web application which downloads the Sentinel-1 images and then applies a chain of SNAP operators to pre-process the data and to perform a change detection between two S1 images.
I am facing a Java memory leak problem (i.e. Java heap memory keeps growing without being release by the garbage collector) while the referred SNAP operators over time. I will try to further detail the problem...
I am using SNAP version 4.0.1 and S1tbx version 4.0.0 and I am importing the following:
Before calling any SNAP operators I perform the initialization by calling:
and each operator is called like follows:
GPF.createProduct(opName, parameters, prods);
On each pair of images, for each image, I call the following pre-processing SNAP operators:
and then I perform the change detection by applying the "BandMaths" operator.
Note that each execution of the above mentioned processing chain is run in a separate thread.
The Java heap memory keeps growing after each execution until it reaches a point where the application crashes with an out of memory exception.
Analyzing a crash memory dump, it is possible to see that most of the Java heap memory is occupied by instances of "javax.imageio.stream.MemoryCache" instances:
Any idea why these cache objects are not released? Can anyone help me on this issue?
Thank you in advance!