Increasing Java Heap Memory of target machine so that EXE runs on target machine with MCR

조회 수: 6 (최근 30일)
This helps with increasing Java Heap Memory on the developer machine
If I have a target machine that has only the MCR intalled... which hangs because of "" how do I increase the Java Heap Memory relevant for Matlab EXE on that machine? What should I tell the user on Windows 10 to do? Will increasing it using the "Control Panel - Programs - Java" be good enough? (i.e. http://www.messiahpsychoanalyst.org/wikihow/index.php/How_to_Increase_Java_Memory_in_Windows)
Or is there some way to specifically increase it for Matlab based EXE that run on the MCR?
  댓글 수: 3
Purnendu Nath
Purnendu Nath 2019년 9월 26일
Because when my (appdesigner) app crashes after doing (say 1010) simulations for no apparent reason (e.g. if I restart it at 1009 it continues again) the red error message in the command window includes the following:
java.lang.OutOfMemoryError: Java heap space
Guillaume
Guillaume 2019년 9월 26일
In tha case, then indeed incresing the java heap may help. However, it would be interesting to find what is exhausting the java memory. appdesigner apps don't rely on java as far as I know.
If you can attach your app code, so we can look into it. Or raise a bug with Mathworks if your license allows it.

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

채택된 답변

Bruno Luong
Bruno Luong 2019년 9월 26일
편집: Bruno Luong 2019년 9월 26일
According to my test, the stand alone app uses the sames amount of java heap memory than your MATLAB preferences.
To set the amount of Java heap memory you can either uses the menu in the toolstrip
Menu Preferences -> General - Java Heap Memory
or edit the file prefernce file
>> edit(fullfile(prefdir,'matlab.prf'));
the put desired amount of the memory in Mb in the line (here 1Gb)
JavaMemHeapMax=I1024
Then compile your app
On Windows platform if you want to change the Heap after compilation. Run the app once then close it. then goes the folder
C:\Users\XXX\AppData\Local\Temp\XXX\mcrCacheM.N\APPNAME_YYY\.matlab
where XXX is the user name, M.N, APPNAME depends on your MCR version and application name, edit the line
JavaMemHeapMax=I1024
then relauch your app.
  댓글 수: 7
Bruno Luong
Bruno Luong 2021년 8월 3일
Please open new thread describe in detail your app does and error message you get.
Aubai
Aubai 2021년 8월 3일
편집: Aubai 2021년 8월 3일
Hallo Bruno,
Thanks very much for the support and i already did here but with the old (first) question i had at the start.
this is the idea the app is not giving me any errors (Windows is doing so so when i am using the App with JavaMemHeapMax =I0 windows is losing it and telling me that i need to close my App as it is using alot of memory).
after playing with the JavaMemHeapMax then the memory at some time is limiting itself to a very low value lower that the set value in JavaMemHeapMax which i can not understand or explain.
I even asked a question about memory limitation of Matlab EXE Apps here also
Best Regards

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

추가 답변 (1개)

Purnendu Nath
Purnendu Nath 2019년 9월 27일
Bruno, all of the above has worked perfectly...
Thanks a lot!

카테고리

Help CenterFile Exchange에서 Web Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by