Nashorn JJS: set heap size on command line

253 Views Asked by At

Using the JJS tool for Nashorn+ JVM, how do we set JVM arguments?

I tried this:

jjs -Xmx512m test.js

but got this:

"-Xmx512m" is not a recognized option. Use "-h" or "-help" to see a list of all supported options.

Sepcifically I want to set the following

-XX:MaxDirectMemorySize=512m
-Xmx512m

1

There are 1 best solutions below

0
On BEST ANSWER

For JJS use -J before jvm args:

-J-Xmx512m -J-XX:MaxDirectMemorySize=512m