public static long getHeapSizeOfClient() {
    return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory());
  }
This is for testing heap size from Mbean
geode-core/src/distributedTest/java/org/apache/geode/management/internal/pulse/TestHeapDUnitTest.java