4

I have a compiled *.jar file, which is actually Scala code. I want to run this application from a terminal with increased JVM memory. The way I run it so far is:

scala MyApp.jar 

The above works, the app is running.

and this:

scala -Dname=Xmx2g MyApp.jar or scala -Dname=-Xmx2g MyApp.jar

I do this to use more JVM memory, the app is actually running, but does not seem to use more memory.

How can I run a Scala application (*.jar file) with increased JVM memory?

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
Al Jenssen
  • 655
  • 3
  • 9
  • 25

1 Answers1

1

The scala command requires use of the -J option in order to pass options on to the JVM. So, the command line you probably want is: scala -J-Xmx2g MyApp.jar

FYI, the -Dname=Xmx2g would define a system property named name and give it the value Xmx2g, probably not what you want.

Reid Spencer
  • 2,776
  • 28
  • 37