Пример #1
0
    @Override
    protected void runTest(Cache cache, Toolkit clusteringToolkit) throws Throwable {
      cache = cacheManager.getCache("testEventual");

      int size = 40 * 1024 * 1024;
      byte[] b = new byte[size];

      long time = System.currentTimeMillis();

      cache.put(new Element(1, b));

      while (cache.calculateInMemorySize() < size) {
        Thread.sleep(1);
      }

      time = System.currentTimeMillis() - time;

      System.err.println(
          "time taken = "
              + time
              + " "
              + cache.calculateOffHeapSize()
              + " "
              + cache.calculateInMemorySize());
    }
 public long calculateInMemorySize() throws IllegalStateException, CacheException {
   return cache.calculateInMemorySize();
 }