user2105282
user2105282

Reputation: 804

Increasing Java Heap Size

I'm trying to increase value of heap size of my jvm, but it doesn't work. Could anybody help me with this geek problem? My configuration are follow: Windows 7 x64, 4 GB, i3 CPU

enter image description here

enter image description here

When I try something like -Xmx2000M I have nothingenter image description here

Where are my errors?

Upvotes: 0

Views: 10356

Answers (6)

Jack
Jack

Reputation: 97

may be I am late) But I think you can use it. In IDEA choose Edit Configuration... on drop-down list(look on picture below). And then type in VM Options your parameters -Xmx2000M -Xms1000M. How to find Edit Configuration on IDEA

Upvotes: 0

s.d
s.d

Reputation: 29436

You need to provide something for JVM to run with these new settings.

The arguments you are using only configure the JVM, it still needs whatever jar or class file you want to run.

To permanently configure JVM profile on windows, follow these Instructions. The settings tool will let you edit runtime parameters:

enter image description here

Upvotes: 0

Hang Zhou
Hang Zhou

Reputation: 54

I think you are expecting this.

$ java -Xmx2000M -Xms1000M -XshowSettings:all

VM settings:
   Min. Heap Size: 1000.00M
   Max. Heap Size: 1.95G
   Ergonomics Machine Class: server
   Using VM: Java HotSpot(TM) 64-Bit Server VM

Upvotes: 4

Vishwanath
Vishwanath

Reputation: 6004

The error you have got in the last screen shot is about unavailability of the class file to run.
You should provide class file which includes main function while running java command.

java -Xmx2000M -Xms1000m MyClass

Considering you have MyClass.class in your classpath.

Upvotes: 0

araknoid
araknoid

Reputation: 3125

Your command is half correct. You need to specify what you want to run with an increased heap size. Something like this

java -Xmx2000M -Xms1000M -jar <jar-file-name>.jar

Upvotes: 1

koljaTM
koljaTM

Reputation: 10262

you need to specify as well which class/jar you want to run. You cannot just increase the heap size per default for all java pplications. Instead you have to edit the command line of the program you are trying to run.

Upvotes: 0

Related Questions