Package com.tamingtext.util

Examples of com.tamingtext.util.MemoryStatus.dumpMemory()


  @Test
  public void testMemoryUsageNonPooled() throws IOException {
    File modelDir = getModelDir();
    MemoryStatus memStatus = new MemoryStatus();
    memStatus.dumpMemory("before non-pooled model load");
    //String[] names = {"person"};
    //String[] names = {"date","location","money","organization","percentage","person","time"};
    String[] names = {"person","location","date"};
    NameFinderME[] finders = new NameFinderME[names.length];
    for (int mi = 0; mi < names.length; mi++) {
View Full Code Here


      finders[mi] = new NameFinderME(new TokenNameFinderModel(
          new FileInputStream(
              new File(modelDir, "en-ner-" + names[mi] + ".bin")
              )));
    }
    memStatus.dumpMemory("after non-pooled model load of " + Arrays.toString(names));
   
    //    ----------before non-pooled model load----------
    //    Code Cache 511.88 KBytes
    //    Par Eden Space 6.32 MBytes
    //    Par Survivor Space 0.00 Bytes
View Full Code Here

 
  @Test
  public void testMemoryUsagePooled() throws IOException {
    File modelDir = getModelDir();
    MemoryStatus memStatus = new MemoryStatus();
    memStatus.dumpMemory("before pooled model load");
    //String[] names = {"person"};
    //String[] names = {"date","location","money","organization","percentage","person","time"};
    //<start id="ne-pool"/>
    String[] names = {"person","location","date"};
    NameFinderME[] finders = new NameFinderME[names.length];
View Full Code Here

    /*<calloutlist>
    <callout arearefs="co.opennlp.name.init4"><para>Initialize name finders for identifying people, locations, and dates</para></callout>
    <callout arearefs="co.opennlp.name.pool"><para>Use the string-pooling model to reduce memory footprint.</para></callout>
    </calloutlist>*/
    //<end id="ne-pool"/>
    memStatus.dumpMemory("after pooled model load of " + Arrays.toString(names));
   
    //    ----------before pooled model load----------
    //    Code Cache 514.13 KBytes
    //    Par Eden Space 6.18 MBytes
    //    Par Survivor Space 0.00 Bytes
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.