@Override
  public void unbindFrom(AbstractMetricService metricService) {
    for (BufferPoolMXBean bufferPoolBean :
        ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class)) {
      metricService.remove(
          MetricType.AUTO_GAUGE,
          SystemMetric.JVM_BUFFER_COUNT_BUFFERS.toString(),
          SystemTag.ID.toString(),
          bufferPoolBean.getName());

      metricService.remove(
          MetricType.AUTO_GAUGE,
          SystemMetric.JVM_BUFFER_MEMORY_USED_BYTES.toString(),
          SystemTag.ID.toString(),
          bufferPoolBean.getName());

      metricService.remove(
          MetricType.AUTO_GAUGE,
          SystemMetric.JVM_BUFFER_TOTAL_CAPACITY_BYTES.toString(),
          SystemTag.ID.toString(),
          bufferPoolBean.getName());
    }

    for (MemoryPoolMXBean memoryPoolBean :
        ManagementFactory.getPlatformMXBeans(MemoryPoolMXBean.class)) {
      String area = MemoryType.HEAP.equals(memoryPoolBean.getType()) ? "heap" : "nonheap";

      metricService.remove(
          MetricType.AUTO_GAUGE,
          SystemMetric.JVM_MEMORY_USED_BYTES.toString(),
          SystemTag.ID.toString(),
          memoryPoolBean.getName(),
          SystemTag.AREA.toString(),
          area);

      metricService.remove(
          MetricType.AUTO_GAUGE,
          SystemMetric.JVM_MEMORY_COMMITTED_BYTES.toString(),
          SystemTag.ID.toString(),
          memoryPoolBean.getName(),
          SystemTag.AREA.toString(),
          area);

      metricService.remove(
          MetricType.AUTO_GAUGE,
          SystemMetric.JVM_MEMORY_MAX_BYTES.toString(),
          SystemTag.ID.toString(),
          memoryPoolBean.getName(),
          SystemTag.AREA.toString(),
          area);
    }
  }
This file is modified from io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/jvm/JvmMemoryMetrics.java