Out of memory error when calling a MATLAB JA Builder compiled component

조회 수: 1 (최근 30일)
James
James 2011년 9월 12일
I'm having a strange problem with calling a MATLAB JA Builder compiled code in Java. Details are as follows:
  1. The code does a load() on a large .mat file
  2. If the mat file was opened in MATLAB (by importing the .mat), everything works fine and takes up ~900MB of memory
  3. If the code is called from an Java app (which simply imports the function built by JA Builder), I get out of memory from the MATLAB script
  4. I have tried setting Xmx really high, but that doesn't seem to do anything at all
  5. What is weirder, is that if the java program is run through the Eclipse debugger, it can use up to 900MB of ram and the load() function succeeds
Does anyone know what could be happening?
Thanks in advanced
----------------
I have attached a part of the stack trace:
??? Error using ==> load Out of memory. Type HELP MEMORY for your options.
... Matlab M-code Stack Trace ... file C:\Users\HiME\AppData\Local\MathWorks\mcr_cache_v78\fileProcesso_39586D5669D9A968B2CD5231A43620E4\fileProcesso\getHeaders.m,name getHeaders,line at 8. com.mathworks.toolbox.javabuilder.MWException: Error using ==> load Out of memory. Type HELP MEMORY for your options.Error in =>getHeaders.m at 8

답변 (1개)

Joan Puig
Joan Puig 2011년 9월 12일
Hi,
Are you properly disposing the native references in your java code?
MWArray.disposeArray(...)
We found not doing that to be a problem for us under certain conditions.
  댓글 수: 1
James
James 2011년 9월 12일
Hi,
I am disposing the references somewhere later down the line, but the load() call is the very first line of MATLAB code to be run and that fails with out of memory.
Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Java Package Integration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by