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.
<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"
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.
这个参数应该可以解决问题: -Drun.jvmArguments="-Xmx512m -xms1024"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.