Mssm
Mssm

Reputation: 787

Increasing the JVM heap memory using Xmx doesn't work

I'm developping a javafx application which has much ui interfaces, and while opening many windows, the jvm start consumming much memory (going up tp 350mb).

When it arrives to 360mb, the programs starts lagging and end up by being crashed (nothing works, screen blocks ...) and the console show a OutOfMemoryException with Java Heap Space error

I've 6gb of memory in my computer, and tried to start the .jar file using -Xmx param, but still the operating system doesn't allow the jvm to consume more memory.

Is there anything else i should specify so that the jvm may be able to get as much memory as it needs ?

Upvotes: 1

Views: 1106

Answers (1)

Apostolos Emmanouilidis
Apostolos Emmanouilidis

Reputation: 7197

You might want to ensure that you're using:

java -Xmx1024m -jar YourApplication.jar

and not:

java -jar YourApplication.jar -Xmx1024m

Anything after the .jar is considered as argument passed to your executable Jar.

Upvotes: 2

Related Questions