@Override
  public ObjectNode execute(final HttpServletRequest request) throws Exception {

    // get cluster object
    Cluster cluster = repository.getCluster();

    // json object to be sent as response
    ObjectNode responseJSON = mapper.createObjectNode();

    // cluster's Memory Usage trend added to json response object

    responseJSON.put("currentMemoryUsage", cluster.getUsedHeapSize());
    responseJSON.set("memoryUsageTrend",
        mapper.valueToTree(cluster.getStatisticTrend(Cluster.CLUSTER_STAT_MEMORY_USAGE)));

    // Send json response
    return responseJSON;
  }
Class ClusterMemoryUsageService

This class contains implementations of getting Cluster's overall current memory usage details and
its trend over the time.

@since GemFire version 7.5
geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/service/ClusterMemoryUsageService.java