Skip to content

Custom VM Args

Martin Lippert edited this page Jan 18, 2021 · 2 revisions

Passing specific VM arguments to the language server process

Eclipse

When using the Spring Tools 4 on top of Eclipse, you can now specify and pass custom VM arguments to the language server process. In order to do that, add an additional system property at the end of your eclipse.ini or SpringToolSuite4.ini file. For example:

-Dboot.ls.custom.vmargs=-Xmx3G to pass the argument -Xmx3G to the language server process.

You can also specify more than one argument, for example:

-Dboot.ls.custom.vmargs=-Xmx3048m,-Xdebug,-Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n

This sets the max heap size to 3048m and various debug options.

Usually you don't need to specify any VM arguments for that language server process, but it opens up a lot of possibilities for analyzing and debugging issues - or to change the settings in case that is needed for other reasons.

Visual Studio Code

You can do the same in Visual Studio Code. Open the Settings in VSCode, navigate to the Extensions -> Boot-Java Configuration -> Spring Boot-ls-java-vmargs setting, there you can configure JVM args for the language server process. If you open the settings.json file, you can add an array for JVM args like:

    "spring-boot.ls.java.vmargs": [
        "-Xmx1G"
    ]
Clone this wiki locally