Use of the Jmap command (Java Memory Map)

Source: Internet
Author: User

Jmap can be used for reference:

Official Document Http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html

and this blog http://blog.csdn.net/fenglibing/article/details/6411953

This article mainly introduces several parameters commonly used by Jmap as their own memos. Note that if you are using a 64-bit JVM, you need to add-j-d64 when using Jmap


1. Print the number of instances per class, memory consumption, class full name information. Live sub-parameters, counting only the number of live objects.

> Jmap-histo:live 6824

Num     #instances         #bytes  class name----------------------------------------------   1:          1232         238144  [C   2:           414          48184  <constMethodKlass>   3:          32712  [B   4 :           414          29864  <methodKlass>   5:          29512  <constantPoolKlass>   6:          1084          26016  java.lang.String


2, print the permanent generation of ClassLoader related information

>jmap-permstat 6824
Class_loader    Classes bytes   Parent_loader   alive?  type<bootstrap>     382     1684072   null          live    <internal>0x2a3a7fe0      0       0         Null          live    sun/misc/[email protected]0x2a3aa748      6       51592   0x2a3a7fe0      Live    sun/ Misc/[email protected]

3, showing the allocation and use of memory, for understanding the JVM memory allocation is very useful,displays information about the memory of the young generation, the old age, and the permanent generation.
>jmap-heap 6824
Using Thread-local object allocation. Mark Sweep Compact gcheap Configuration:   minheapfreeratio = 40

4, the most commonly used to get memory dump

can refer to http://blog.csdn.net/aitangyong/article/details/24012535 this blog


Use of the Jmap command (Java Memory Map)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.