public void cleanup() {
    // TODO: periodically reload a new HiveConf to check if stats reporting is enabled.
    hiveCache.cleanUp();

    if (enableStats) {
      LOG.info("Cache statistics after cleanup: size=" + hiveCache.size() + " " + hiveCache.stats());
    }
  }
Note: This doesn't check if they are being used or not, meant only to be called during shutdown etc.
metastore/src/java/org/apache/hadoop/hive/metastore/HiveClientCache.java