Commits

Hiroyoshi Komatsu committed 5446146

Add unlimited heep size option

  • Participants
  • Parent commits 50c824e

Comments (0)

Files changed (2)

 
     sudo pip install jsonrpclib pexpect unidecode   # unidecode is optional
     git clone https://bitbucket.org/torotoki/corenlp-python.git
-	  cd corenlp-python/corenlp
+	  cd corenlp-python
     wget http://nlp.stanford.edu/software/stanford-corenlp-full-2013-04-04.zip
     unzip stanford-corenlp-full-2013-04-04.zip
 

corenlp/corenlp.py

                 print "Error! Cannot locate %s" % jar
                 sys.exit(1)
 
+        # add memory limit on JVM
+        if memory:
+            limit = "-Xmx%s" % memory
+        else:
+            limit = ""
+
         # spawn the server
-        start_corenlp = "%s -Xmx%s -cp %s %s %s" % (java_path, memory, ':'.join(jars), classname, props)
+        start_corenlp = "%s %s -cp %s %s %s" % (java_path, limit, ':'.join(jars), classname, props)
         if VERBOSE: print start_corenlp
         self.corenlp = pexpect.spawn(start_corenlp)