How can I configure the heap size when starting a Spring Boot application with embedded Tomcat?

If starting the application with the spring-boot plugin:

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

Otherwise if running java -jar:

java -Xmx512m -Dspring.profiles.active=dev -jar app.jar

Leave a Comment