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

4 vues (au cours des 30 derniers jours)
Lennaert van Veen
Lennaert van Veen le 18 Oct 2016
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!

Réponses (1)

Soma Ardhanareeswaran
Soma Ardhanareeswaran le 21 Oct 2016
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.

Catégories

En savoir plus sur MATLAB Runtime dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by