0
public static void main(String[] args)
{
String parsed_sentence = null;
        try {

            parsed_data = new FileInputStream("src/DATA/en-parser-chunking.zip");
            System.out.println("fetched from the file");
            ParserModel model = new ParserModel(parsed_data);
            System.out.println("model created");
            Parser parser = ParserFactory.create(model);
            System.out.println("parseer created");
            String t = "The quick brown fox jumps over the lazy dog .";
            opennlp.tools.parser.Parse topParses[] = ParserTool.parseLine(t, parser, 1);
            System.out.println("parsed ");
            System.out.println(topParses[0]);
        }
        catch (Exception ex)
        {
          System.out.println("Error");
        }

    }  
}
}

Output : fetched from the file Exception in thread "main" java.lang.OutOfMemoryError: Java heap space....

while running this project in Netbeans ,I am getting this error i dont know what to do. I did exactly told on the OpenNLP site http://opennlp.apache.org/documentation/1.5.2-incubating/manual/opennlp.html#tools.parser .

Harshil Shah
  • 363
  • 4
  • 9
  • 18
  • 1
    Try by providing more memory to your program using `-Xmx` option while running. Have a look at http://stackoverflow.com/questions/1493913/how-to-set-the-maximum-memory-usage-for-jvm and http://www.oracle.com/technetwork/java/javase/memorymanagement-whitepaper-150215.pdf – Ravindra Gullapalli Mar 10 '13 at 17:18
  • still same error continuous... :(.... – Harshil Shah Mar 10 '13 at 19:31
  • @RavindraGullapalli thnx that worked after i add that in my projects run variable in netbeans.... – Harshil Shah Mar 12 '13 at 13:32

1 Answers1

1

(Java heap space in netbeans.. but I've increased the heap size already!)...... This has solved my problem... i need to add that in my project's VMX variable....

Community
  • 1
  • 1
Harshil Shah
  • 363
  • 4
  • 9
  • 18