java.lang.management.MemoryType#NON_HEAP源码实例Demo

下面列出了java.lang.management.MemoryType#NON_HEAP 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Flink-CEPplus   文件: MemoryLogger.java
/**
 * Gets the memory pool statistics from the JVM.
 *
 * @param poolBeans The collection of memory pool beans.
 * @return A string denoting the names and sizes of the memory pools.
 */
public static String getMemoryPoolStatsAsString(List<MemoryPoolMXBean> poolBeans) {
	StringBuilder bld = new StringBuilder("Off-heap pool stats: ");
	int count = 0;
	
	for (MemoryPoolMXBean bean : poolBeans) {
		if (bean.getType() == MemoryType.NON_HEAP) {
			if (count > 0) {
				bld.append(", ");
			}
			count++;

			MemoryUsage usage = bean.getUsage();
			long used = usage.getUsed() >> 20;
			long committed = usage.getCommitted() >> 20;
			long max = usage.getMax() >> 20;
			
			bld.append('[').append(bean.getName()).append(": ");
			bld.append(used).append('/').append(committed).append('/').append(max);
			bld.append(" MB (used/committed/max)]");
		}
	}

	return bld.toString();
}
 
源代码2 项目: flink   文件: MemoryLogger.java
/**
 * Gets the memory pool statistics from the JVM.
 *
 * @param poolBeans The collection of memory pool beans.
 * @return A string denoting the names and sizes of the memory pools.
 */
public static String getMemoryPoolStatsAsString(List<MemoryPoolMXBean> poolBeans) {
	StringBuilder bld = new StringBuilder("Off-heap pool stats: ");
	int count = 0;
	
	for (MemoryPoolMXBean bean : poolBeans) {
		if (bean.getType() == MemoryType.NON_HEAP) {
			if (count > 0) {
				bld.append(", ");
			}
			count++;

			MemoryUsage usage = bean.getUsage();
			long used = usage.getUsed() >> 20;
			long committed = usage.getCommitted() >> 20;
			long max = usage.getMax() >> 20;
			
			bld.append('[').append(bean.getName()).append(": ");
			bld.append(used).append('/').append(committed).append('/').append(max);
			bld.append(" MB (used/committed/max)]");
		}
	}

	return bld.toString();
}
 
源代码3 项目: flink   文件: MemoryLogger.java
/**
 * Gets the memory pool statistics from the JVM.
 *
 * @param poolBeans The collection of memory pool beans.
 * @return A string denoting the names and sizes of the memory pools.
 */
public static String getMemoryPoolStatsAsString(List<MemoryPoolMXBean> poolBeans) {
	StringBuilder bld = new StringBuilder("Off-heap pool stats: ");
	int count = 0;
	
	for (MemoryPoolMXBean bean : poolBeans) {
		if (bean.getType() == MemoryType.NON_HEAP) {
			if (count > 0) {
				bld.append(", ");
			}
			count++;

			MemoryUsage usage = bean.getUsage();
			long used = usage.getUsed() >> 20;
			long committed = usage.getCommitted() >> 20;
			long max = usage.getMax() >> 20;
			
			bld.append('[').append(bean.getName()).append(": ");
			bld.append(used).append('/').append(committed).append('/').append(max);
			bld.append(" MB (used/committed/max)]");
		}
	}

	return bld.toString();
}
 
源代码4 项目: hbase   文件: MemorySizeUtil.java
/**
 * @return Pair of global memstore size and memory type(ie. on heap or off heap).
 */
public static Pair<Long, MemoryType> getGlobalMemStoreSize(Configuration conf) {
  long offheapMSGlobal = conf.getLong(OFFHEAP_MEMSTORE_SIZE_KEY, 0);// Size in MBs
  if (offheapMSGlobal > 0) {
    // Off heap memstore size has not relevance when MSLAB is turned OFF. We will go with making
    // this entire size split into Chunks and pooling them in MemstoreLABPoool. We dont want to
    // create so many on demand off heap chunks. In fact when this off heap size is configured, we
    // will go with 100% of this size as the pool size
    if (MemStoreLAB.isEnabled(conf)) {
      // We are in offheap Memstore use
      long globalMemStoreLimit = (long) (offheapMSGlobal * 1024 * 1024); // Size in bytes
      return new Pair<>(globalMemStoreLimit, MemoryType.NON_HEAP);
    } else {
      // Off heap max memstore size is configured with turning off MSLAB. It makes no sense. Do a
      // warn log and go with on heap memstore percentage. By default it will be 40% of Xmx
      LOG.warn("There is no relevance of configuring '" + OFFHEAP_MEMSTORE_SIZE_KEY + "' when '"
          + MemStoreLAB.USEMSLAB_KEY + "' is turned off."
          + " Going with on heap global memstore size ('" + MEMSTORE_SIZE_KEY + "')");
    }
  }
  return new Pair<>(getOnheapGlobalMemStoreSize(conf), MemoryType.HEAP);
}
 
@Override
protected RegionProcedureStore createProcedureStore(Path storeDir) throws IOException {
  Pair<Long, MemoryType> pair = MemorySizeUtil.getGlobalMemStoreSize(conf);
  long globalMemStoreSize = pair.getFirst();
  boolean offheap = pair.getSecond() == MemoryType.NON_HEAP;
  float poolSizePercentage = offheap ? 1.0F :
    conf.getFloat(MemStoreLAB.CHUNK_POOL_MAXSIZE_KEY, MemStoreLAB.POOL_MAX_SIZE_DEFAULT);
  float initialCountPercentage =
    conf.getFloat(MemStoreLAB.CHUNK_POOL_INITIALSIZE_KEY, MemStoreLAB.POOL_INITIAL_SIZE_DEFAULT);
  int chunkSize = conf.getInt(MemStoreLAB.CHUNK_SIZE_KEY, MemStoreLAB.CHUNK_SIZE_DEFAULT);
  ChunkCreator.initialize(chunkSize, offheap, globalMemStoreSize, poolSizePercentage,
    initialCountPercentage, null);
  conf.setBoolean(MasterRegionFactory.USE_HSYNC_KEY, "hsync".equals(syncType));
  CommonFSUtils.setRootDir(conf, storeDir);
  MockServer server = new MockServer(conf);
  region = MasterRegionFactory.create(server);
  return new RegionProcedureStore(server, region, (fs, apth) -> {
  });
}
 
源代码6 项目: dragonwell8_jdk   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码7 项目: TencentKona-8   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码8 项目: jdk8u60   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码9 项目: openjdk-jdk8u   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码10 项目: openjdk-jdk8u-backup   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码11 项目: openjdk-jdk9   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码12 项目: jdk8u-jdk   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码13 项目: hottub   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码14 项目: openjdk-8-source   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码15 项目: openjdk-8   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码16 项目: jdk8u_jdk   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码17 项目: jdk8u-jdk   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码18 项目: jdk8u-dev-jdk   文件: MemoryPoolImpl.java
public MemoryType getType() {
    if (isHeap) {
        return MemoryType.HEAP;
    } else {
        return MemoryType.NON_HEAP;
    }
}
 
源代码19 项目: hbase   文件: RegionServerAccounting.java
boolean isOffheap() {
  return this.memType == MemoryType.NON_HEAP;
}
 
 同类方法