3

i'm using the new spring-boot 1.3.0 feature to run tomcat embedded spring-boot application jar as a unix service.

All is working fine but i don't know how to tune jvm (with -Xms and -Xmx parameters for example)

I've searched in spring documentation and around the web without success.

2 Answers2

4

It's missing from the documentation (I've opened an issue to correct that), but you should be able to use the JAVA_OPTS environment variable.

You can configure it in a .conf file that's situated next to the jar. For example, if you jar file is /var/myapp/myapp.jar, the file /var/myapp/myapp.conf will be sourced by the launch script.

Andy Wilkinson
  • 108,729
  • 24
  • 257
  • 242
0

There is one more option to achieve the same , if you are running jar with mvn you can do something like this

mvn spring-boot:run -Drun.jvmArguments="-Xmx512m"

And If you are running with java -jar ,you can try something like this

java -Xmx1G -jar myapp.jar

ULLAS K
  • 881
  • 2
  • 11
  • 24