注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

阿弥陀佛

街树飘影未见尘 潭月潜水了无声 般若观照心空静...

 
 
 

日志

 
 
关于我

一直从事气象预报、服务建模实践应用。 注重气象物理场、实况场、地理信息、本体知识库、分布式气象内容管理系统建立。 对Barnes客观分析, 小波,计算神经网络、信任传播、贝叶斯推理、专家系统、网络本体语言有一定体会。 一直使用Java、Delphi、Prolog、SQL编程。

网易考拉推荐

Monitoring the JVM  

2012-06-10 15:21:34|  分类: groovy|ruby |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication1

import java.lang.management.*

def os = ManagementFactory.operatingSystemMXBean
println """OPERATING SYSTEM:
\tarchitecture = $os.arch
\tname = $os.name
\tversion = $os.version
\tprocessors = $os.availableProcessors
"""

def rt = ManagementFactory.runtimeMXBean
println """RUNTIME:
\tname = $rt.name
\tspec name = $rt.specName
\tvendor = $rt.specVendor
\tspec version = $rt.specVersion
\tmanagement spec version = $rt.managementSpecVersion
"""

def cl = ManagementFactory.classLoadingMXBean
println """CLASS LOADING SYSTEM:
\tisVerbose = ${cl.isVerbose()}
\tloadedClassCount = $cl.loadedClassCount
\ttotalLoadedClassCount = $cl.totalLoadedClassCount
\tunloadedClassCount = $cl.unloadedClassCount
"""

def comp = ManagementFactory.compilationMXBean
println """COMPILATION:
\ttotalCompilationTime = $comp.totalCompilationTime
"""

def mem = ManagementFactory.memoryMXBean
def heapUsage = mem.heapMemoryUsage
def nonHeapUsage = mem.nonHeapMemoryUsage
println """MEMORY:
HEAP STORAGE:
\tcommitted = $heapUsage.committed
\tinit = $heapUsage.init
\tmax = $heapUsage.max
\tused = $heapUsage.used
NON-HEAP STORAGE:
\tcommitted = $nonHeapUsage.committed
\tinit = $nonHeapUsage.init
\tmax = $nonHeapUsage.max
\tused = $nonHeapUsage.used
"""

ManagementFactory.memoryPoolMXBeans.each{ mp ->
    println "\tname: " + mp.name
    String[] mmnames = mp.memoryManagerNames
    mmnames.each{ mmname ->
        println "\t\tManager Name: $mmname"
    }
    println "\t\tmtype = $mp.type"
    println "\t\tUsage threshold supported = " + mp.isUsageThresholdSupported()
}
println()

def td = ManagementFactory.threadMXBean
println "THREADS:"
td.allThreadIds.each { tid ->
    println "\tThread name = ${td.getThreadInfo(tid).threadName}"
}
println()

println "GARBAGE COLLECTION:"
ManagementFactory.garbageCollectorMXBeans.each { gc ->
    println "\tname = $gc.name"
    println "\t\tcollection count = $gc.collectionCount"
    println "\t\tcollection time = $gc.collectionTime"
    String[] mpoolNames = gc.memoryPoolNames
    mpoolNames.each { mpoolName ->
        println "\t\tmpool name = $mpoolName"
    }
}
=========================================================================
ant -f C:\\Users\\hxfcalf\\Documents\\NetBeansProjects\\JavaApplication1 -Djavac.includes=javaapplication1/n1.groovy -Drun.class=javaapplication1.n1 run-single
init:
Deleting: C:\Users\hxfcalf\Documents\NetBeansProjects\JavaApplication1\build\built-jar.properties
deps-jar:
Updating property file: C:\Users\hxfcalf\Documents\NetBeansProjects\JavaApplication1\build\built-jar.properties
Compiling 1 source file to C:\Users\hxfcalf\Documents\NetBeansProjects\JavaApplication1\build\classes
compile-single:
run-single:
OPERATING SYSTEM:
    architecture = amd64
    name = Windows 7
    version = 6.1
    processors = 8

RUNTIME:
    name = 33088@hxfcalf-THINK
    spec name = Java Virtual Machine Specification
    vendor = Oracle Corporation
    spec version = 1.7
    management spec version = 1.2

CLASS LOADING SYSTEM:
    isVerbose = false
    loadedClassCount = 997
    totalLoadedClassCount = 997
    unloadedClassCount = 0

COMPILATION:
    totalCompilationTime = 116

MEMORY:
HEAP STORAGE:
    committed = 62521344
    init = 65195776
    max = 928382976
    used = 14702856
NON-HEAP STORAGE:
    committed = 24313856
    init = 24313856
    max = 136314880
    used = 9220048

    name: Code Cache
        Manager Name: CodeCacheManager
        mtype = Non-heap memory
        Usage threshold supported = true
    name: PS Eden Space
        Manager Name: PS MarkSweep
        Manager Name: PS Scavenge
        mtype = Heap memory
        Usage threshold supported = false
    name: PS Survivor Space
        Manager Name: PS MarkSweep
        Manager Name: PS Scavenge
        mtype = Heap memory
        Usage threshold supported = false
    name: PS Old Gen
        Manager Name: PS MarkSweep
        mtype = Heap memory
        Usage threshold supported = true
    name: PS Perm Gen
        Manager Name: PS MarkSweep
        mtype = Non-heap memory
        Usage threshold supported = true

THREADS:
    Thread name = Attach Listener
    Thread name = Signal Dispatcher
    Thread name = Finalizer
    Thread name = Reference Handler
    Thread name = main

GARBAGE COLLECTION:
    name = PS Scavenge
        collection count = 1
        collection time = 6
        mpool name = PS Eden Space
        mpool name = PS Survivor Space
    name = PS MarkSweep
        collection count = 0
        collection time = 0
        mpool name = PS Eden Space
        mpool name = PS Survivor Space
        mpool name = PS Old Gen
        mpool name = PS Perm Gen
成功生成(总时间:1 秒)
  评论这张
 
阅读(713)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017