3

I want to alter (increase) java memory limit (JRE on windows pc). I fount following commands everywhere:

-Xms set initial Java heap size

-Xmx set maximum Java heap size

for example -Xmx1024m.

But my Question is where! do I have to enter this command. Sorry for this beginner question. Normally I do not have any contact to java.

  • 1
    those are parameters that you pass in the command line when you start the app – ΦXocę 웃 Пepeúpa ツ Jun 02 '17 at 08:55
  • 2
    Possible duplicate of [How to set the -Xmx when start running a jar file?](https://stackoverflow.com/questions/20149304/how-to-set-the-xmx-when-start-running-a-jar-file) – pablochan Jun 02 '17 at 08:55
  • 1
    make sure to read this answer aswell ;-) https://stackoverflow.com/questions/20149304/how-to-set-the-xmx-when-start-running-a-jar-file/42207984#42207984 – aexellent Jun 02 '17 at 09:01

2 Answers2

4

If you are using eclipse and try to run standalone java then use vm argument section in run configuration tab .For tomcat or app server in setenv script file put

set JAVA_OPTS=-Xms1024m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=384m 

for executable jar

java -Xms1024m -Xmx1024m -jar FILENAME.jar
gati sahu
  • 2,576
  • 2
  • 10
  • 16
0

Those are Arguments for the Virtual Machine that you pass in the command line when you start the app

example:

in the console doing:

java -Xms256m -Xmx1024m HelloWorld

or if you are in eclipse (or any other ide) enter image description here

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97