title: In R: How do i solve "Out of memory" error in POS tagger?
body: <p>In R, i have a data with 30 records for sample, main data has 20000 records. records are tweets. 
  I extract bigrams from any tweet and i use from postagger. For sample data,that shown me errors</p>
  
  <blockquote>
    <p>.jnew("opennlp.tools.postag.POSModel",
    .jcast(.jnew("java.io.FileInputStream",  :<br>
    java.lang.OutOfMemoryError: Java heap space</p>
  </blockquote>
  
  <p>or</p>
  
  <blockquote>
    <p>.jnew("opennlp.tools.tokenize.TokenizerModel",
    .jcast(.jnew("java.io.FileInputStream",  :<br>
    java.lang.OutOfMemoryError: GC overhead limit exceeded</p>
  </blockquote>
  
  <p>How do i solve this peroblem? </p>
  
  <p>My code is :
      how do i solve this peroblem? </p>
  
  <pre><code>    for(i in 1:nrow(data1))
  {
   .
   .
   .
  
   for(k in 1:length(bigrams))
   {
     s = as.String(bigrams[k])
     sent_token_annotator =openNLP:: Maxent_Sent_Token_Annotator()
     word_token_annotator = openNLP::Maxent_Word_Token_Annotator()
     a2 = annotate(s, list(sent_token_annotator, word_token_annotator))
     pos_tag_annotator = openNLP::Maxent_POS_Tag_Annotator()
     a3 = annotate(s, pos_tag_annotator, a2)
     a3w = subset(a3, type == "word")
     tags = sapply(a3w$features, `[[`, "POS")
     if(tags[1]=="JJ") 
      {
        if(tags[2]=="NN"||tags[2]=="NNS")
        {
          bigram_final[j]=bigrams[k]
          j=j+1;
        }
    .
    .
    .
    }
  }
  </code></pre>