@Test
  public void testLargeOffHeapGetAllFromServer() throws Throwable {
    final Host host = Host.getHost(0);
    final VM server = host.getVM(0);
    final VM client = host.getVM(1);
    final String regionName = getUniqueName();
    final int serverPort = AvailablePortHelper.getRandomAvailableTCPPort();
    final String serverHost = NetworkUtils.getServerHostName(server.getHost());

    createBridgeServer(server, regionName, serverPort, false, false, true/* offheap */);

    createBridgeClient(client, regionName, serverHost, new int[] {serverPort}, true);

    final int VALUE_SIZE = 1024 * 2/* *1024 */;

    final int VALUE_COUNT = 100;

    client.invoke(new CacheSerializableRunnable("put entries on server") {
      @Override
      public void run2() throws CacheException {
        final byte[] VALUE = new byte[VALUE_SIZE];
        for (int i = 0; i < VALUE_SIZE; i++) {
          VALUE[i] = (byte) i;
        }
        Region region = getRootRegion(regionName);
        for (int i = 0; i < VALUE_COUNT; i++) {
          region.put("k" + i, new UnitTestValueHolder(VALUE));
        }
      }
    });

    CacheSerializableRunnable clientGetAll =
        new CacheSerializableRunnable("Get all entries from server") {
          @Override
          public void run2() throws CacheException {
            // Build collection of keys
            Collection keys = new ArrayList();
            for (int i = 0; i < VALUE_COUNT; i++) {
              keys.add("k" + i);
            }

            // Invoke getAll
            Region region = getRootRegion(regionName);
            final int GET_COUNT = 10/* 0 */;
            long start = System.currentTimeMillis();
            Map result = null;
            for (int i = 0; i < GET_COUNT; i++) {
              result = null; // allow gc to get rid of previous map before deserializing the next
                             // one
              result = region.getAll(keys);
            }
            long end = System.currentTimeMillis();
            long totalBytesRead = ((long) GET_COUNT * VALUE_COUNT * VALUE_SIZE);
            long elapsedMillis = (end - start);
            System.out.println("PERF: read " + totalBytesRead + " bytes in " + elapsedMillis
                + " millis. bps=" + (((double) totalBytesRead / elapsedMillis) * 1000));

            // Verify result size is correct
            assertEquals(VALUE_COUNT, result.size());

            final byte[] EXPECTED = new byte[VALUE_SIZE];
            for (int i = 0; i < VALUE_SIZE; i++) {
              EXPECTED[i] = (byte) i;
            }
            // Verify the result contains each key,
            // and the value for each key is correct
            // (the server has a loader that returns the key as the value)
            for (final Object o : keys) {
              String key = (String) o;
              assertTrue(result.containsKey(key));
              Object value = result.get(key);
              if (value instanceof UnitTestValueHolder) {
                Object v = ((UnitTestValueHolder) value).getValue();
                if (v instanceof byte[]) {
                  byte[] bytes = (byte[]) v;
                  if (bytes.length != VALUE_SIZE) {
                    fail("expected value for key " + key + " to be an array of size " + (VALUE_SIZE)
                        + " but it was: " + bytes.length);
                  }
                  if (!Arrays.equals(EXPECTED, bytes)) {
                    fail("expected bytes=" + Arrays.toString(bytes) + " to be expected="
                        + Arrays.toString(EXPECTED));
                  }
                } else {
                  fail("expected v for key " + key + " to be a byte array but it was: " + v);
                }
              } else {
                fail("expected value for key " + key + " to be a UnitTestValueHolder but it was: "
                    + value);
              }
            }
          }
        };
    // Run getAll
    {
      final int THREAD_COUNT = 4;
      AsyncInvocation<?>[] ais = new AsyncInvocation[THREAD_COUNT];
      for (int i = 0; i < THREAD_COUNT; i++) {
        ais[i] = client.invokeAsync(clientGetAll);
      }
      for (int i = 0; i < THREAD_COUNT; i++) {
        ais[i].getResult();
      }
    }

    server.invoke(new CacheSerializableRunnable("Dump OffHeap Stats") {
      @Override
      public void run2() throws CacheException {
        MemoryAllocatorImpl ma = MemoryAllocatorImpl.getAllocator();
        System.out.println("STATS: objects=" + ma.getStats().getObjects() + " usedMemory="
            + ma.getStats().getUsedMemory() + " reads=" + ma.getStats().getReads());
      }
    });

    checkServerForOrphans(server, regionName);

    stopBridgeServer(server);
  }
Class <code>ClientServerGetAllDUnitTest</code> test client/server getAll.

@since GemFire 5.7
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerGetAllDUnitTest.java