Hi, YuFei,

You should set JVM memory options. I don't know how to do it in NetBeans,
but using Eclipse:

- Run Configurations
- Arguments
- VM Arguments: -Xmx1024m

NetBeans should have a similar configuration.

Regards,
William


On Wed, Mar 30, 2011 at 8:41 AM, Zhu YuFei <[email protected]> wrote:

> Dear openNLP JAVA API developers:
>
> I currently have an problem using the JAVA API for open NLP, where I have
> include the opennlp-1.5.0.jar in my java library and followed the API guide
> on wiki in exactly same.
>
> however, there are system out of memory errors of it, the error is as
> following:
>
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>        at java.util.Arrays.copyOfRange(Arrays.java:3209)
>        at java.lang.String.<init>(String.java:215)
>        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:75)
>        at
> opennlp.model.GenericModelReader.constructModel(GenericModelReader.java:55)
>        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.<init>(BaseModel.java:135)
>        at opennlp.tools.parser.ParserModel.<init>(ParserModel.java:169)
>        at nlpprocessor.SentenceParser.ParseSentence(SentenceParser.java:30)
>        at nlpprocessor.Main.main(Main.java:60)
>
>
> I can execute the parser though command line, and I use NetBeans.
>
> I have the line :
>  opennlp.tools.parser.Parse topParses[] = ParserTool.parseLine(sentence,
> parser, 1);
>
> Since netbeans doesn't like I use arse topParses[] in direct.
>
> ------------------------------
> YuFei (Phil) Zhu
>
> Postgraduate(Taught)
>
> [email protected]/ [email protected]
>
> Faculty of Science, Department of Computer Science, The University Of Bath
>
> (+44)07725115456(UK) / (+86)13512501588(China)
>
>

Reply via email to