Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutOfMemoryError when calling EidosSystem.extractFromText #227

Closed
adarshp opened this issue Mar 28, 2018 · 3 comments
Closed

OutOfMemoryError when calling EidosSystem.extractFromText #227

adarshp opened this issue Mar 28, 2018 · 3 comments
Assignees

Comments

@adarshp
Copy link
Member

adarshp commented Mar 28, 2018

I'm getting an OutOfMemoryError when calling the extractFromText method, even though I raised my memory allowance in .sbtopts from 6GB to 12GB (this is what is in .sbtopts: -J-Xmx12G. Here is the sequence of actions that produces the error:

Bring up the scala REPL using scala, then do:

import org.clulab.wm.eidos.EidosSystem
val reader = new EidosSystem()
val text = "Conflict causes displacement"
val annotatedDocument = reader.extractFromText(text, true)

Can anybody reproduce this error?

Here is the error log:

java.lang.OutOfMemoryError: Java heap space
  at java.io.ObjectInputStream$HandleTable.grow(ObjectInputStream.java:3468)
  at java.io.ObjectInputStream$HandleTable.assign(ObjectInputStream.java:3275)
  at java.io.ObjectInputStream.readString(ObjectInputStream.java:1650)
  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)
  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
  at java.util.HashMap.readObject(HashMap.java:1394)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:483)
  at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
  at edu.stanford.nlp.ie.crf.CRFClassifier.loadClassifier(CRFClassifier.java:2591)
  at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifier(AbstractSequenceClassifier.java:1468)
  at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifier(AbstractSequenceClassifier.java:1500)
  at edu.stanford.nlp.ie.crf.CRFClassifier.getClassifier(CRFClassifier.java:2941)
  at edu.stanford.nlp.ie.ClassifierCombiner.loadClassifierFromPath(ClassifierCombiner.java:282)
  at edu.stanford.nlp.ie.ClassifierCombiner.loadClassifiers(ClassifierCombiner.java:266)
  at edu.stanford.nlp.ie.ClassifierCombiner.<init>(ClassifierCombiner.java:142)
  at edu.stanford.nlp.ie.NERClassifierCombiner.<init>(NERClassifierCombiner.java:128)
  at edu.stanford.nlp.pipeline.NERCombinerAnnotator.<init>(NERCombinerAnnotator.java:91)
  at edu.stanford.nlp.pipeline.AnnotatorImplementations.ner(AnnotatorImplementations.java:70)
  at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getNamedAnnotators$44(StanfordCoreNLP.java:498)
  at edu.stanford.nlp.pipeline.StanfordCoreNLP$$Lambda$1351/1167582947.apply(Unknown Source)
  at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getDefaultAnnotatorPool$65(StanfordCoreNLP.java:533)
@MihaiSurdeanu
Copy link
Contributor

The scala REPL does not obey .sbtopts. I suspect you'll have to set the memory allowance from the cmd line of scala.

@adarshp
Copy link
Member Author

adarshp commented Mar 28, 2018

That works, thanks!

@adarshp adarshp closed this as completed Mar 28, 2018
@ajaynagesh
Copy link
Contributor

@adarshp : If you do want the scala REPL and still have sbt load your project (and read .sbtopts), you could try:

sbt console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants