How can I increase JVM heap size in my application executable jar file? The project type is Maven Project.
Asked
Active
Viewed 681 times
0
-
I don't think you can set heap size in a jar file. – J Fabian Meier Aug 28 '19 at 18:38
-
The heap size can only be configured for the JVM which mean not possible within the executable jar only from outside via `java -X ...`... – khmarbaise Aug 28 '19 at 18:40
1 Answers
1
You cannot do this within the jar file. Instead, start your Jar-File app.jar
with the following parameters:
java -jar -Xms30G -Xmx100G app.jar
- Xms: initial heap size (here 30 GB)
- Xmx: maximum heap size (here 100 GB)
Note that this is independent from your project type.
You can also set these parameters within your IDE:

yascho
- 314
- 1
- 6