Package java.lang.management

Examples of java.lang.management.RuntimeMXBean


   * dump and bring up resultant hprof in something like jprofiler which
   * allows you get 'deep size' on objects.
   * @param args main args
   */
  public static void main(String [] args) {
    RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
    LOG.info("vmName=" + runtime.getVmName() + ", vmVendor=" +
      runtime.getVmVendor() + ", vmVersion=" + runtime.getVmVersion());
    LOG.info("vmInputArguments=" + runtime.getInputArguments());
    MemStore memstore1 = new MemStore();
    // TODO: x32 vs x64
    long size = 0;
    final int count = 10000;
    byte [] fam = Bytes.toBytes("col");
View Full Code Here


        {
            assertEquals("Cause message incorrect", "Permission denied: Update createNewQueue", e.getMessage());
        }

        // Ensure that calls to MBeans outside the Qpid domain are not impeded.
        final RuntimeMXBean runtimeBean = _jmx.getManagedObject(RuntimeMXBean.class, ManagementFactory.RUNTIME_MXBEAN_NAME);
        runtimeBean.getName();
        // PASS
    }
View Full Code Here

    public Date getKernelBootTime() {
        return kernel.getBootTime();
    }

    public Stats getStats() {
        RuntimeMXBean runmxbean = ManagementFactory.getRuntimeMXBean();
        MemoryMXBean memmxbean = ManagementFactory.getMemoryMXBean();
        MemoryUsage memUsage = memmxbean.getHeapMemoryUsage();
        CountStatisticImpl upTime;
        BoundedRangeStatisticImpl heapSize;
       
        if (stats == null) {
            stats = new JVMStatsImpl();
            // setup UpTime CountStatistic
            upTime = stats.getUpTimeImpl();
            upTime.setStartTime(runmxbean.getStartTime());
            upTime.setCount(runmxbean.getUptime());
            // setup Heap BoundedRangeStatistic
            heapSize = stats.getHeapSizeImpl();
            heapSize.setStartTime(runmxbean.getStartTime());
            heapSize.setBounds(0, memUsage.getMax());
            heapSize.setCurrent(memUsage.getUsed());
            heapSize.setLowWaterMark(memUsage.getUsed());
            heapSize.setHighWaterMark(memUsage.getUsed());
        } else {
            // update UpTime CountStatistic
            upTime = stats.getUpTimeImpl();
            upTime.setCount(runmxbean.getUptime());
            // update Heap BoundedRangeStatistic
            heapSize = stats.getHeapSizeImpl();
            heapSize.setBounds(0, memUsage.getMax());
            heapSize.setCurrent(memUsage.getUsed());
        }
View Full Code Here

   * dump and bring up resultant hprof in something like jprofiler which
   * allows you get 'deep size' on objects.
   * @param args main args
   */
  public static void main(String [] args) {
    RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
    LOG.info("vmName=" + runtime.getVmName() + ", vmVendor=" +
      runtime.getVmVendor() + ", vmVersion=" + runtime.getVmVersion());
    LOG.info("vmInputArguments=" + runtime.getInputArguments());
    MemStore memstore1 = new MemStore();
    // TODO: x32 vs x64
    long size = 0;
    final int count = 10000;
    byte [] fam = Bytes.toBytes("col");
View Full Code Here

  // KeyValue, LruBlockCache, LruHashMap<K,V>, Put, HLogKey
 
  @BeforeClass
  public static void beforeClass() throws Exception {
    // Print detail on jvm so we know what is different should below test fail.
    RuntimeMXBean b = ManagementFactory.getRuntimeMXBean();
    LOG.info("name=" + b.getName());
    LOG.info("specname=" + b.getSpecName());
    LOG.info("specvendor=" + b.getSpecVendor());
    LOG.info("vmname=" + b.getVmName());
    LOG.info("vmversion=" + b.getVmVersion());
    LOG.info("vmvendor=" + b.getVmVendor());
    Map<String, String> p = b.getSystemProperties();
    LOG.info("properties=" + p);
  }
View Full Code Here

public class JMXTest {

   @Test
   public void test() {

      final RuntimeMXBean runtime = createMock(RuntimeMXBean.class);

      expect(runtime.getUptime()).andReturn(69876000l);

      replay(runtime);

      Injector injector = Guice.createInjector(new AbstractModule() {
         @Override
View Full Code Here

   * dump and bring up resultant hprof in something like jprofiler which
   * allows you get 'deep size' on objects.
   * @param args main args
   */
  public static void main(String [] args) {
    RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
    LOG.info("vmName=" + runtime.getVmName() + ", vmVendor=" +
      runtime.getVmVendor() + ", vmVersion=" + runtime.getVmVersion());
    LOG.info("vmInputArguments=" + runtime.getInputArguments());
    MemStore memstore1 = new MemStore();
    // TODO: x32 vs x64
    long size = 0;
    final int count = 10000;
    byte [] fam = Bytes.toBytes("col");
View Full Code Here

   * allows you get 'deep size' on objects.
   * @param args
   * @throws InterruptedException
   */
  public static void main(String [] args) throws InterruptedException {
    RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
    LOG.info("vmName=" + runtime.getVmName() + ", vmVendor=" +
      runtime.getVmVendor() + ", vmVersion=" + runtime.getVmVersion());
    LOG.info("vmInputArguments=" + runtime.getInputArguments());
    Memcache memcache1 = new Memcache();
    // TODO: x32 vs x64
    long size = 0;
    final int count = 10000;
    for (int i = 0; i < count; i++) {
View Full Code Here

          // LocalHBaseCluster.  It manages 'local' clusters.
          if (LocalHBaseCluster.isLocal(conf)) {
            LOG.warn("Not starting a distinct region server because " +
              "hbase.master is set to 'local' mode");
          } else {
            RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
            if (runtime != null) {
              LOG.info("vmInputArguments=" + runtime.getInputArguments());
            }
            Constructor<? extends HRegionServer> c =
              regionServerClass.getConstructor(HBaseConfiguration.class);
            HRegionServer hrs = c.newInstance(conf);
            Thread t = new Thread(hrs);
View Full Code Here

   * Code to test sizes of BatchUpdate arrays.
   * @param args
   * @throws InterruptedException
   */
  public static void main(String[] args) throws InterruptedException {
    RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
    LOG.info("vmName=" + runtime.getVmName() + ", vmVendor="
        + runtime.getVmVendor() + ", vmVersion=" + runtime.getVmVersion());
    LOG.info("vmInputArguments=" + runtime.getInputArguments());
    final int count = 10000;
    BatchUpdate[] batch1 = new BatchUpdate[count];
    // TODO: x32 vs x64
    long size = 0;
    for (int i = 0; i < count; i++) {
View Full Code Here

TOP

Related Classes of java.lang.management.RuntimeMXBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.