ehcache - How to avoid lost data in Terracotta BigMemory Go -


i'm testing bigmemory go performances, , notice lost of data.

this unit test:

public class bigmemorygoperformancetest {      public static void main(string[] args) throws ioexception {         bigmemorygoperformancetest test = new bigmemorygoperformancetest();         test.testbigmemorygoperformance(args[0], long.valueof(args[1]), long.valueof(args[2]));     }      @dataprovider(name = "bigmemorygoperformance")     public object[][] bigmemorygoperformance() {         return new object[][] {                    { "very small", 250000, 1 }                   ,{ "small", 1000000, 2 }                   ,{ "large", 10000000, 2 }                   ,{ "very large", 50000000, 4 }         };     }      @test(dataprovider="bigmemorygoperformance")     public void testbigmemorygoperformance(string testname, long maxregisters, long externalmemory) throws ioexception {          configuration managerconfiguration = new configuration();         managerconfiguration.updatecheck(true)             .monitoring(configuration.monitoring.autodetect)             .name("config")             .cache(new cacheconfiguration()                 .name("testperformance")                 .maxbyteslocalheap(128, memoryunit.megabytes)                 .maxbyteslocaloffheap(externalmemory, memoryunit.gigabytes)                 .eternal(true)             );          cachemanager manager = cachemanager.create(managerconfiguration);         cache cache = manager.getcache("testperformance");          try {             system.out.println("first pass: insert " + maxregisters + " nodes.");             long mms = system.currenttimemillis();             (long = 0; < maxregisters; i++) {                 itemfortesting item = new itemfortesting();                 item.id = i;                 item.lastway = i;                 item.latitude = new double(i);                 item.longitude = new double(i);                 cache.put( new element(i, item) );             }             long timeinmms = system.currenttimemillis() - mms;             system.out.println(testname + " --> inserted " + maxregisters + " registers in " + timeinmms + " mms. performance: " + ((long)(maxregisters * 1000d / timeinmms)) + " regs per seconds writing." );               system.out.println("second pass: reading " + maxregisters + " nodes.");             mms = system.currenttimemillis();             (long = 0; < maxregisters; i++) {                 element element = cache.get(i);                 itemfortesting item = (itemfortesting)element.getobjectvalue(); // <--- null point exception !!!!!             }             timeinmms = system.currenttimemillis() - mms;             system.out.println(testname + " --> read " + maxregisters + " registers in " + timeinmms + " mms. performance: " + ((long)(maxregisters * 1000d / timeinmms)) + " regs per seconds reading." );              system.out.println("third pass: updating " + maxregisters + " nodes.");             mms = system.currenttimemillis();             (long = 0; < maxregisters; i++) {                 element element = cache.get(i);                 itemfortesting item = (itemfortesting)element.getobjectvalue();                 item.latitude = item.latitude +1;                 cache.put( new element(i, item) );             }             timeinmms = system.currenttimemillis() - mms;             system.out.println(testname + " --> updated " + maxregisters + " registers in " + timeinmms + " mms. performance: " + ((long)(maxregisters * 1000d / timeinmms)) + " regs per seconds reading." );              system.out.println("fourth pass: deleting " + maxregisters + " nodes.");             mms = system.currenttimemillis();             (long = 0; < maxregisters; i++) {                 element element = cache.get(i);                 itemfortesting item = (itemfortesting)element.getobjectvalue();                 item.latitude = item.latitude +1;                 cache.remove( new element(i, item) );             }             timeinmms = system.currenttimemillis() - mms;             system.out.println(testname + " --> removed " + maxregisters + " registers in " + timeinmms + " mms. performance: " + ((long)(maxregisters * 1000d / timeinmms)) + " regs per seconds reading." );           } {             if (manager != null) manager.shutdown();         }      }  } 

in "very large", using 50.000.000 iterations, when read data in second pass, return null. data lost!! configuration set eternal = true. how avoid lost data?

what wrong?

thanks!

i suspect need pin elements avoid expiration. try config looks this:

<cache name="mybigmemorygostore"     maxbyteslocalheap="1m"     eternal="true"     maxbyteslocaloffheap="2g">     <persistence strategy="none"/>     <pinning store="incache" />     <sizeofpolicy maxdepth="100000" maxdepthexceededbehavior="continue"/> 

http://terracotta.org/documentation/4.0/bigmemorygo/configuration/data-life


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -