title: How to use Data-Store in Embedded Gate NLP
body: <p>I am new to <code>Gate Nlp</code>. I have more than 100 documents to process . But after Processing 20-25 documents , Throws <code>out of memory exception</code> . So , I want to use now <code>datastore</code> to store the corpus .So that it will release the memory after processing it .I have  a <code>gapp</code> file of the application , through which it loads the document . My code is like </p>
  
  <pre><code>  if (!Gate.isInitialised()) {
              Gate.runInSandbox(true);
              Gate.init();
          }
  
  
  
          application = (CorpusController) PersistenceManager.loadObjectFromFile(gapFile);
          // Create a Corpus to use.  We recycle the same Corpus object for each
          // iteration.  The string parameter to newCorpus() is simply the
          // GATE-internal name to use for the corpus.  It has no particular
          // significance.
          corpus = Factory.newCorpus(AppConstants.MAIN_CORPUS);
          application.setCorpus(corpus);
          doc = Factory.newDocument(new File(docFilePath).toURI().toURL());
          // put the document in the corpus
          corpus.add(doc);
          // run the application
          application.execute();
          }
  </code></pre>
  
  <p>After this i am deleting the corpus .After deleting also  , it is not clearing the memory .How can i solve this  ?</p>