How to exclude the Java virtual machine from astand-alone application?

3 ビュー (過去 30 日間)
Lennaert van Veen
Lennaert van Veen 2016 年 10 月 18 日
回答済み: Soma Ardhanareeswaran 2016 年 10 月 21 日
I want to use the mcc compiler to generate a stand-alone application to run on a shared cluster. Due to memory restrictions, I want to exclude jvm. I use
mcc -m -R -nojvm -R -nosplash -R -nodisplay -R -nodesktop -R -singleCompThread -I [included directories] -o application_name
During compiling, I get the message:
Warning: You have specified '-R -nojvm', which may restrict or eliminate MATLAB graphics functionality at runtime.
That sounds good. Now I set
ulimit -v 1000000
because that is the setting on the shared machine. Then I run
sh run_application_name.sh $mcrroot
with $mcrroot pointing to my Matlab runtime installation. The results is:
------------------------------------------ Setting up environment variables --- LD_LIBRARY_PATH is .:/usr/local/MATLAB/R2016a//runtime/glnxa64:/usr/local/MATLAB/R2016a//bin/glnxa64:/usr/local/MATLAB/R2016a//sys/os/glnxa64:/usr/local/MATLAB/R2016a//sys/opengl/lib/glnxa64 Opening log file: /home/veen/java.log.20374 Fatal Error on startup: Unable to start the JVM. Error occurred during initialization of VM Could not reserve enough space for object heap
There is not enough memory to start up the Java virtual machine. Try quitting other applications or increasing your virtual memory. ----------------------------
What am I missing? It seems that the JVM is started anyway. Moreover, if I compile again right away (on the same machine and terminal) I even get the "Unable to start the JVM" message at compile time!

回答 (1 件)

Soma Ardhanareeswaran
Soma Ardhanareeswaran 2016 年 10 月 21 日
Which version of MATLAB are you using to compile the standalone application? Can you try creating a standalone with the -nojvm option for the following code?
surf(peaks)
This code should fail by throwing 'Error using gcf' since the application tries to use the JVM then the compiled application does not support it.

カテゴリ

Help Center および File ExchangeStandalone Applications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by