Nashorn JJS: set heap size on command line

241 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 answers

0
adamM On BEST ANSWER

For JJS use -J before jvm args:

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