I am trying to deploy a Spring Boot powered web app to production. The app is built with Spring Boot 1.0.1 and has the default Tomcat 7 embedded as application server. I want to allocate larger memory to the app when start the app with java -jar myapp.jar command line.
java -jar myapp.jar
Should I use JVM parameter such as -Xms -Xmx or use environment variable such as JAVA_OPTS? I have tried to look for the answer in documentation or google it, but I did not get an answer. Can anyone give some hints?
-Xms -Xmx
JAVA_OPTS
If starting the application with the spring-boot plugin:
spring-boot
mvn spring-boot:run -Drun.jvmArguments="-Xmx512m" -Drun.profiles=dev
Otherwise if running java -jar:
java -jar
java -Xmx512m -Dspring.profiles.active=dev -jar app.jar
1.4m articles
1.4m replys
5 comments
57.0k users