I am trying my hands on the Stanford dependency parser. I tried running the parser from command line on windows to extract the dependencies using this command:
java -mx100m -cp "stanford-parser.jar" edu.stanford.nlp.trees.EnglishGrammaticalStructure -sentFile english-onesent.txt -collapsedTree -CCprocessed -parserFile englishPCFG.ser.gz
I am getting the following error:
Error occurred during initialization of VM
Too small initial heap
I changed the memory size to -mx1024, -mx2048 as well as -mx4096. It didn't change anything and the error persists.
What am I missing?
You can resolve this issue by running Solaris JVM with option -d64. -d64 command-line option allows JVM to use a 64-bit data model if available.
[Fixed] Initial heap size set to a larger value than the maximum heap size. To get rid of this error, the value of Xmx(maximum heap size) should always be greater than or equal to Xms(minimum heap size).
If you look carefully you will space between -Xmx and 1800M, which is causing "Could not create the Java virtual machine: Invalid maximum heap size -Xmx". syntactically there should not be any space between -Xmx and heap size. Just remove the space between -Xmx and 1400M and it will work.
Type -Xmx1024m
instead of -mx1024
.
See https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html
It should be -mx1024m. I skipped m.
One more thing: in the -cp, the model jar should also be included.
... -cp "stanford-parser.jar;stanford-parser-3.5.2-models.jar"...
(assuming you are using the latest version).
Otherwise an IO Exception will be thrown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With