六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 180|回复: 0

'jmap'

[复制链接]

升级  66.67%

40

主题

40

主题

40

主题

秀才

Rank: 2

积分
150
 楼主| 发表于 2013-2-7 13:05:40 | 显示全部楼层 |阅读模式
"jmap" - Memory Map: Prints shared object memory maps or heap memory details of a given JVM process or a Java core file on the local machine or on a remote machine through a debug server. "jmap" supports several functions with these syntaxes:

jmap [ option ] pid
jmap [ option ] executable core
jmap [ option ] [server-id@]remote-hostname-or-IP

<no option>
    When no option is used jmap prints shared object mappings.
    For each shared object loaded in the target VM, start address,
    the size of the mapping, and the full path of the shared object
    file are printed. This is similar to the Solaris pmap utility.

-dump:[live,]format=b,file=<filename>
    Dumps the Java heap in hprof binary format to filename. The live
    suboption is optional. If specified, only the live objects in the
    heap are dumped. To browse the heap dump, you can use jhat (Java
    Heap Analysis Tool) to read the generated file.

-finalizerinfo
    Prints information on objects awaiting finalization.

-heap
    Prints a heap summary. GC algorithm used, heap configuration and
    generation wise heap usage are printed.

-histo[:live]
    Prints a histogram of the heap. For each Java class, number of
    objects, memory size in bytes, and fully qualified class names
    are printed. VM internal class names are printed with '*' prefix.
    If the live suboption is specified, only live objects are counted.

-permstat
    Prints class loader wise statistics of permanent generation of
    Java heap. For each class loader, its name, liveness, address,
    parent class loader, and the number and size of classes it has
    loaded are printed. In addition, the number and size of interned
    Strings are printed.

-F
    Force. Use with jmap -dump or jmap -histo option if the pid does
    not respond. The live suboption is not supported in this mode.

But the "jmap" tool included in the Windows version of JDK 1.6 only supports functions to print histogram of Java object heap and generate a heap dump of a given JVM process:

C:\herong>\Progra~1\java\jdk1.6.0_02\bin\jmap

Usage:
    jmap -histo <pid>
      (to print histogram of java object heap of the JVM process)
    jmap -dump:<dump-options> <pid>
      (to dump java heap of the JVM process)

    dump-options:
      format=b     binary default
      file=<file>  dump heap to <file>

    Example: jmap -dump:format=b,file=heap.bin <pid>

See the next section on how to use "jmap" to print heap histogram and to generate heap dump.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表