Soil Moisture - Java heap space

Hello!

I am using snap because I want to calculate the Soil Moisture Content, using the appropriate toolbox. When I do an End-to-End MultiAngle graph for the Soil Moisture calculation it does not work. I am using images from Sentinel1.

The result is a Java heap space error, here is the log:
java.lang.NullPointerException
Caused: org.esa.snap.core.gpf.OperatorException
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:440)
at org.csa.rstb.soilmoisture.gpf.support.HallikainenDielectricModel.computeTileStack(HallikainenDielectricModel.java:193)
at org.csa.rstb.soilmoisture.gpf.SMDielectricModelInverOp.computeTileStack(SMDielectricModelInverOp.java:144)
Caused: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:440)
at org.csa.rstb.soilmoisture.gpf.SMDielectricModelInverOp.computeTileStack(SMDielectricModelInverOp.java:146)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:122)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:86)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at javax.media.jai.PlanarImage.getData(Unknown Source)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeRect(OperatorImageTileStack.java:116)
[catch] at org.esa.snap.core.gpf.internal.OperatorImageTileStack.computeTile(OperatorImageTileStack.java:86)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
at com.sun.media.jai.util.WorkerThread.run(Unknown Source)

I hope someone can help me! :smiley:
Thank you!

Did you had a look into the FAQ already? If not, please do so.
Collection of FAQs - SNAP - SNAP Wiki (atlassian.net)

1 Like

Hello @marpet

I knew that I had to change the value of java_max_mem and I had put 40 GB, because I have 64GB of RAM. However, I have now followed the advice in the FAQ. Thank you. :blush:

Also you should not make very complex graphs as they consume more heap and easily become inefficient. Try splitting the graph in two parts for example.

1 Like