@Override
  protected CacheFactory getCacheFactory() {
    CacheFactory factory = super.getCacheFactory();
    factory.set(ConfigurationProperties.OFF_HEAP_MEMORY_SIZE, "100m");
    return factory;
  }
Tests of lucene index creation that use off heap memory
geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationOffHeapIntegrationTest.java