Topics

Increasing Java memory for dita command line

Dan Vint
 

I'm using this

../dita-ot/dita-ot-3.4.1/bin/dita -d -v -Xmx2048m\
--input=/Users/danvint/pubsrc/doc-tools/sample-content/MD/PF.ditamap \
--format=ping-training-pdf \
--output=output -t=temp

I'm getting

java.lang.IllegalArgumentException: -Xmx2048m
at org.dita.dost.invoker.ArgumentParser.processArgs(ArgumentParser.java:323)
at org.dita.dost.invoker.Main.processArgs(Main.java:265)
at org.dita.dost.invoker.Main.startAnt(Main.java:158)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

The DITA OT documentation talks about adding memory but it modifies the ant files. Is there a correct way to pass this at the command line?

Radu Coravu
 

Hi Dan,

You cannot pass the memory setting as a parameter to the DITA OT process because the process has already started when it takes that parameter into account and by then it is too late.

So indeed as the docs says you need to set an environmental variable either in the command line or in the script which starts the processing (the dita.bat):

https://www.dita-ot.org/dev/topics/increasing-the-jvm.html

Regards,

Radu

Radu Coravu
Oxygen XML Editor

On 7/24/20 9:25 PM, Dan Vint wrote:
I'm using this

../dita-ot/dita-ot-3.4.1/bin/dita  -d -v -Xmx2048m\
--input=/Users/danvint/pubsrc/doc-tools/sample-content/MD/PF.ditamap \
     --format=ping-training-pdf \
     --output=output -t=temp

I'm getting

java.lang.IllegalArgumentException: -Xmx2048m
    at org.dita.dost.invoker.ArgumentParser.processArgs(ArgumentParser.java:323)
    at org.dita.dost.invoker.Main.processArgs(Main.java:265)
    at org.dita.dost.invoker.Main.startAnt(Main.java:158)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

The DITA OT documentation talks about adding memory but it modifies the ant files. Is there a correct way to pass this at the command line?

Jarno Elovirta
 

Use

$ ANT_OPTS=-Xmx2048m ../dita-ot/dita-ot-3.4.1/bin/dita [arguments]

or

$ export ANT_OPTS=-Xmx2048m
$ ../dita-ot/dita-ot-3.4.1/bin/dita [arguments]

J

On 24. Jul 2020, at 21.25, Dan Vint <dvint@...> wrote:

I'm using this

../dita-ot/dita-ot-3.4.1/bin/dita -d -v -Xmx2048m\
--input=/Users/danvint/pubsrc/doc-tools/sample-content/MD/PF.ditamap \
--format=ping-training-pdf \
--output=output -t=temp

I'm getting

java.lang.IllegalArgumentException: -Xmx2048m
at org.dita.dost.invoker.ArgumentParser.processArgs(ArgumentParser.java:323)
at org.dita.dost.invoker.Main.processArgs(Main.java:265)
at org.dita.dost.invoker.Main.startAnt(Main.java:158)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

The DITA OT documentation talks about adding memory but it modifies the ant files. Is there a correct way to pass this at the command line?