Mr. K. O. Rolling
Mr. K. O. Rolling

Reputation: 278

How to increase jvm memory

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.

Upvotes: 3

Views: 9830

Answers (2)

gati sahu
gati sahu

Reputation: 2626

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

Upvotes: 4

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

Upvotes: 0

Related Questions