HeapMemoryMonitor.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:monarch 作者:
/**
 * Stops all three mechanisms from monitoring heap usage.
 */
@Override
public void stopMonitoring() {
  synchronized (this) {
    if (!this.started) {
      return;
    }

    // Stop the poller
    this.resourceManager.stopExecutor(this.pollerExecutor);

    // Stop the JVM threshold listener
    NotificationEmitter emitter = (NotificationEmitter) ManagementFactory.getMemoryMXBean();
    try {
      emitter.removeNotificationListener(this, null, null);
      this.cache.getLoggerI18n().fine("Removed Memory MXBean notification listener" + this);
    } catch (ListenerNotFoundException e) {
      this.cache.getLoggerI18n().fine(
          "This instance '" + toString() + "' was not registered as a Memory MXBean listener");
    }

    // Stop the stats listener
    final GemFireStatSampler sampler = this.cache.getDistributedSystem().getStatSampler();
    if (sampler != null) {
      sampler.removeLocalStatListener(this.statListener);
    }

    this.started = false;
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号