Too Small Initial Heap Error - Stanford Parser

Too Small Initial Heap Error - Stanford Parser

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?

3 Answers

Type -Xmx1024m instead of -mx1024.

See

1

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.

There may be some arguments that are preexisting in the IDE. In eclipse: Go to-> Run as-> run configuration-> Arguments then Delete the arguments that are used previously. Restart your eclipse. Worked for me!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.