@Override
  public void closeCache() {
    super.closeCache();
    MemoryAllocatorImpl.freeOffHeapMemory();
  }
Tests of lucene index creation that use off heap memory
geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationOffHeapIntegrationTest.java