I have tried multiple ways to increase the given memory for the JVM.
The OS is: Ubuntu 18.04.03 LTS
To start the program I use the exec-maven-plugin.
I start it with following command: mvn clean compile exec:java.
However I need more memory.
To check the given memory for the jvm I use: Runtime.getRuntime().maxMemory(). (Currently it's 32gb, 120gb are on the system)
To increase it I have tried multiple things.
- Using the surefire plugin:
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.5</version>
        <configuration>
            <argLine>-Xmx102400m</argLine>
        </configuration>
</plugin>
System.out.println(Runtime.getRuntime().maxMemory()) still prints 32gb.
- set MAVEN_OPTS="-Xmx102400m"
- mvn clean install -DargLine="-Xmx102400m"
 (To be honest I don't even have an idea why this should work.)
I can't use intellij or eclipse to increase the jvm memory, since the program runs on a server.
I don't have any idea left and I can't find an other solution on the web.
 
    