You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently working with the OpenLCA API in Eclipse. But with some Processes/Product Systems, I encounter an OutOfMemoryError during the Calculation of a ProductSystem.
The following is the Print-Stack:
Exception in thread "Thread-0" java.lang.OutOfMemoryError: Java heap space
at org.apache.commons.math3.linear.Array2DRowRealMatrix.copyOut(Array2DRowRealMatrix.java:528)
at org.apache.commons.math3.linear.Array2DRowRealMatrix.getData(Array2DRowRealMatrix.java:253)
at org.apache.commons.math3.linear.LUDecomposition.(LUDecomposition.java:92)
at org.apache.commons.math3.linear.LUDecomposition.(LUDecomposition.java:75)
at org.openlca.core.matrix.solvers.JavaSolver.solve(JavaSolver.java:23)
at org.openlca.core.math.LcaCalculator.calculateContributions(LcaCalculator.java:73)
The line causing the error is the following:
ContributionResult result = calculator.calculateContributions(setup);
I was monitoring my RAM Usage (8GB Machine) and RAM was not required more than 80% shortly before the crash. I do not have this behavior with every calculation, but with many. In OpenLCA itself, the calculations finishes without problems.
The question I ask myself now is, how to remedy this Error?
The text was updated successfully, but these errors were encountered:
You can increase the heap space for your Python script in Eclipse under Run > Run Configuration. There you can set the max. heap space parameter for the JVM via the -Xmx flag, e.g. -Xmx2048M would set it to 2048 megabytes. See also this answer on Stackoverflow.
Also, you could use the native library and the DenseSolver for faster calculations (see line 113 in the example script).
However, I do not use Jython, but Java directly. And in this situation, the Exceptions are thrown. I already raised the Maximum Heap Size, but that unfortunately did not help.
The DenseSolver did not work for me either because i get an UnsatisfiedLinkError. Maybe there is something that I am missing.
Maybe you just need to assign more memory; what happens if you set it to 6G? (for an ecoinvent 3.4 system, openLCA currently needs ~3.5 GB of memory.)
Regarding the link error: as in the Python script, you first need to load the native library before you can use it. So, before you use the dense solver, you would load the library like this:
I am currently working with the OpenLCA API in Eclipse. But with some Processes/Product Systems, I encounter an OutOfMemoryError during the Calculation of a ProductSystem.
The following is the Print-Stack:
Exception in thread "Thread-0" java.lang.OutOfMemoryError: Java heap space
at org.apache.commons.math3.linear.Array2DRowRealMatrix.copyOut(Array2DRowRealMatrix.java:528)
at org.apache.commons.math3.linear.Array2DRowRealMatrix.getData(Array2DRowRealMatrix.java:253)
at org.apache.commons.math3.linear.LUDecomposition.(LUDecomposition.java:92)
at org.apache.commons.math3.linear.LUDecomposition.(LUDecomposition.java:75)
at org.openlca.core.matrix.solvers.JavaSolver.solve(JavaSolver.java:23)
at org.openlca.core.math.LcaCalculator.calculateContributions(LcaCalculator.java:73)
The line causing the error is the following:
ContributionResult result = calculator.calculateContributions(setup);
I was monitoring my RAM Usage (8GB Machine) and RAM was not required more than 80% shortly before the crash. I do not have this behavior with every calculation, but with many. In OpenLCA itself, the calculations finishes without problems.
The question I ask myself now is, how to remedy this Error?
The text was updated successfully, but these errors were encountered: