"Error during serialization" with API for Java and large matrix
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi,
I'm using the MATLAB API for Java to factor large matrices. Within my Java code I start the MatlabEngine:
MatlabEngine eng = MatlabEngine.startMatlab();
Then I call the svd function and pass it a large 2D array of double values as input:
// 'a' is a large double[][]
Object[] results = eng.feval(3, "svd", a);
double[][] S = (double[][])results[1];
double[][] V = (double[][])results[2];
This works very nicely for sizes of the array 'a' up to around 23000x23000. However for larger matrices, the Matlab call throws an exception:
com.mathworks.engine.MatlabExecutionException: svd
at com.mathworks.engine.FutureResult.get(FutureResult.java:64)
at com.mathworks.engine.MatlabEngine.feval(MatlabEngine.java:464)
at sandbox.TestSvdEvd.main(TestSvdEvd.java:184)
Caused by: com.mathworks.mvm.exec.MvmException: Error during serialization
... 3 more
com.mathworks.mvm.exec.MvmException: Error during serialization
Matlab has no problem processing the same matrix in a standalone Matlab process. So I seem to be hitting some memory limit with the MATLAB API for Java, however there's plenty of RAM available to the JVM.
So I guess my question(s) is: am I doing something wrong with the Java API? Is there some way I can increase the memory available to the Matlab engine to avoid this exception?
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Call MATLAB from Java에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!