Java heap space problem when running PCA (tutorial:S1TBX Landcover classification with Sentinel-1 GRD)

Hello I’m dealing with Java heap space problem when running PCA for the tutorial “S1TBX Landcover classification with Sentinel-1 GRD”. I’ve already tried to follow the instructions provided in the forum, by increasing the memory space using Snap conf optimizer. I have 16 GB of ram and I’ve extended the capacity, the cache and the tile size with different options. I’ve tried to perform the analysis on different data and it keeps on giving the same error. I’ve also run the program as an administrator as well as tried to reinstall snap. Can someone help me please?

java.lang.OutOfMemoryError: Java heap space
at org.esa.snap.cluster.PrincipalComponentAnalysisOp.initPca(PrincipalComponentAnalysisOp.java:278)
at org.esa.snap.cluster.PrincipalComponentAnalysisOp.doExecute(PrincipalComponentAnalysisOp.java:161)
at org.esa.snap.core.gpf.internal.OperatorContext.executeOperator(OperatorContext.java:1300)
at org.esa.snap.core.gpf.internal.OperatorContext.executeOperator(OperatorContext.java:1296)
at org.esa.snap.core.gpf.Operator.execute(Operator.java:153)
at org.esa.snap.core.gpf.internal.OperatorExecutor$OperatorImagesProvider.init(OperatorExecutor.java:429)
at org.esa.snap.core.gpf.internal.OperatorExecutor.execute(OperatorExecutor.java:116)
at org.esa.snap.core.gpf.internal.OperatorExecutor.execute(OperatorExecutor.java:109)
at org.esa.snap.core.gpf.internal.OperatorExecutor.execute(OperatorExecutor.java:105)
at org.esa.snap.core.gpf.ui.SingleTargetProductDialog$ProductWriterSwingWorker.doInBackground(SingleTargetProductDialog.java:351)
at org.esa.snap.core.gpf.ui.SingleTargetProductDialog$ProductWriterSwingWorker.doInBackground(SingleTargetProductDialog.java:316)
at com.bc.ceres.swing.progress.ProgressMonitorSwingWorker.doInBackground(ProgressMonitorSwingWorker.java:56)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

How many input bands do you have?


the 4 db bands, as instructed in the tutorial

PCA is among the most RAM consuming tasks in SNAP. Did you only select the four dB bands as input? You can digitize a polygon for a test and reduce the PCA to a smaller area by using it as an AOI.