X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fdistribution%2Fopendaylight%2Fsrc%2Fmain%2Fresources%2Frun.bat;h=72ccd02707ba7f5c76f064e5a16767a42f5fd37f;hb=11161d86d92f769c85de7e7c8621a4f7ad1bb6f9;hp=a8e33d26328876334205d0c7f8f679024eca6332;hpb=effdf86b58e39060b75e6090596b123ec6e8ef69;p=controller.git diff --git a/opendaylight/distribution/opendaylight/src/main/resources/run.bat b/opendaylight/distribution/opendaylight/src/main/resources/run.bat index a8e33d2632..72ccd02707 100644 --- a/opendaylight/distribution/opendaylight/src/main/resources/run.bat +++ b/opendaylight/distribution/opendaylight/src/main/resources/run.bat @@ -10,6 +10,7 @@ SET basedir=%~dp0 SET debugport=8000 SET consoleport=2400 SET jmxport=1088 +SET jvmMaxMemory= SET extraJVMOpts= SET consoleOpts=-console -consoleLog SET PID= @@ -82,6 +83,11 @@ IF "%~1" NEQ "" ( ) GOTO :EOF ) + IF "!CARG:~0,4!"=="-Xmx" ( + SET jvmMaxMemory=!CARG! + SHIFT + GOTO :LOOP + ) IF "!CARG:~0,2!"=="-D" ( SET extraJVMOpts=%extraJVMOpts% !CARG! SHIFT @@ -110,6 +116,19 @@ IF "%debugSuspended%" NEQ "" ( REM ECHO "DEBUG enabled suspended" SET extraJVMOpts=%extraJVMOpts% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%debugport% ) + +IF "%jvmMaxMemory%"=="" ( + SET jvmMaxMemory=-Xmx1G + ECHO ***************************************************************** + ECHO JVM maximum memory was not defined. Setting maximum memory to 1G. + ECHO To define the maximum memory, specify the -Xmx setting on the + ECHO command line. + ECHO e.g. run.bat -Xmx1G + ECHO *****************************************************************" +) + +SET extraJVMOpts=%extraJVMOpts% %jvmMaxMemory% + IF "%jmxEnabled%" NEQ "" ( REM ECHO "JMX enabled " SET extraJVMOpts=%extraJVMOpts% -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=%jmxport% -Dcom.sun.management.jmxremote @@ -140,7 +159,7 @@ SET RUN_CMD="%JAVA_HOME%\bin\java.exe" -Dopendaylight.controller %extraJVMOpts% ECHO %RUN_CMD% if "%startEnabled%" NEQ "" ( - START /B cmd /C CALL %RUN_CMD% + START /B cmd /C CALL %RUN_CMD% > %basedir%\logs\controller.out 2>&1 ECHO Running controller in the background. ) else ( %RUN_CMD%