Uploaded image for project: 'OpenNLP'
  1. OpenNLP
  2. OPENNLP-592

When I attempt to run `bin/opennlp Parser models/en-parser-chunking.bin` I get an error for out of memory on the heap although I give it 4 gigs, is this normal?

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • tools-1.5.3
    • None
    • Parser
    • Mac OSX 10.9 Mavericks (Although it's unreleased I doubt this is the reason I get this situation). Processor: 2.7 GHz Intel Core i7. Memory: 16 GB 1600 MHz DDR3.

    Description

      So I recently checked out from the svn repo `https://svn.apache.org/repos/asf/opennlp/tags/opennlp-1.5.3-rc3` and ran `mvn install` from inside the `opennpl` directory. That finished successfully, all test were successful. Next I downloaded all the english models from `http://opennlp.sourceforge.net/models-1.5/`. Finally, I moved all the model bins into `opennpl-tools/models` and I went into `opennpl-tools` and ran `bin/opennlp Parser models/en-parser-chunking.bin` and received the following backtrace:
      [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project opennlp-tools: An exception occured while executing the Java class. null: InvocationTargetException: Java heap space -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project opennlp-tools: An exception occured while executing the Java class. null
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
      Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. null
      at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:352)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      ... 19 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
      at java.lang.Thread.run(Thread.java:680)
      Caused by: java.lang.OutOfMemoryError: Java heap space
      at java.io.DataInputStream.readUTF(DataInputStream.java:644)
      at java.io.DataInputStream.readUTF(DataInputStream.java:547)
      at opennlp.model.BinaryFileDataReader.readUTF(BinaryFileDataReader.java:61)
      at opennlp.model.AbstractModelReader.readUTF(AbstractModelReader.java:82)
      at opennlp.model.AbstractModelReader.getPredicates(AbstractModelReader.java:119)
      at opennlp.maxent.io.GISModelReader.constructModel(GISModelReader.java:74)
      at opennlp.model.GenericModelReader.constructModel(GenericModelReader.java:59)
      at opennlp.model.AbstractModelReader.getModel(AbstractModelReader.java:87)
      at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
      at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
      at opennlp.tools.util.model.BaseModel.loadModel(BaseModel.java:231)
      at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:181)
      at opennlp.tools.parser.ParserModel.<init>(ParserModel.java:152)
      at opennlp.tools.cmdline.parser.ParserModelLoader.loadModel(ParserModelLoader.java:41)
      at opennlp.tools.cmdline.parser.ParserModelLoader.loadModel(ParserModelLoader.java:32)
      at opennlp.tools.cmdline.ModelLoader.load(ModelLoader.java:62)
      at opennlp.tools.cmdline.parser.ParserTool.run(ParserTool.java:93)
      at opennlp.tools.cmdline.CLI.main(CLI.java:225)
      ... 6 more

      I then edited my POM file and changed the allowed memory on the `maven-surefire-plugin` plugin to 2 gigabytes and the same thing occurred, and then the same for 4 gigabytes. Is this normal behavior? Am I doing something horribly wrong? In advanced, I apologize if this is a silly question!

      Attachments

        Activity

          People

            Unassigned Unassigned
            danzimm Dan Zimmerman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: