Java process memory footprint troubleshooting. In addition to the heap

Source: Internet
Author: User

Java memory can be divided into: heap and meta space. To View the heap:

Jmap-heap PID

View Metaspace:

Use JSTAT-GC pid mc Mu. to view other uses in the process:

The RS occupancy in top is minus the footprint in the jmap-heap.

/proc/$PID/maps Smaps is a more detailed information

Pamp Pid:anon means memory allocation.

$cat/proc/1756/maps | grep deleted to search for "Free State of the mmapfile, once the Free State, here will show that the file has been deleted" How to solve the analysis heap external memory anomaly: Performance: The process is abnormal exit log trace every few hours Description: Crash Hs_err.log The contents of the DLL call, which was originally introduced by JNI Ping, caused the java.exe process to abort abnormally.

JAVA-XX:ERRORFILE=/VAR/LOG/JAVA/JAVA_ERROR%P.LOGJVM Fatal error log (Hs_err_pid.log) analysis
Reason Logical Association:

When memory reaches the Maxdirectmemorysize value set in the JVM, a memory access exception error occurs for the DLL, which eventually causes the Java.exe process to exit unexpectedly.

1. https://elasticsearch.cn/article/178

2. The maximum amount of heap memory can be specified by-xx:maxdirectmemorysize, and when the threshold is reached, the System.GC is called to do a full GC to reclaim the Free State of the heap out of memory. [Heap of external memory garbage recycling] gzip causes Java Native memory leak case
Another methodological article: Java uses heap memory to cause swap high #29https://github.com/nereuschen/blog/issues/29


java-xx:maxmetaspacesize=50m Metadataoomsimulator 100000000https://stackoverflow.com/questions/39084331/ Why-metaspace-size-is-twice-as-big-as-used-metaspace?utm_medium=organic&utm_source=google_rich_qa&utm_ Campaign=google_rich_qa

Usecompressedclasspointers

Compressedclassspacesize: A partition involving Metaspace: Kclass,nonkclass.

This is also why, clearly configured the

Metaspacesize = 268435456 (256.0MB)
Compressedclassspacesize = 1073741824 (1024.0MB)

Maxmetaspacesize = 268435456 (256.0MB)

But Jstat shows

s0c s1c s0u s1u EC EU OC OU MC MU CCSC CCSU YG C YGCT FGC FGCT GCT

174720.0 174720.0 0.0 31685.6 1747712.0 373119.2 2097152.0 517354.5 142208.0 139045.9 16512.0 15730.3 6325-194.00 7 0 0.000 194.007


Annex: https://blog.csdn.net/fei33423/article/details/80136920

Gperftools in-Heap memory analysis (case JVM inflater memory leak analysis)

Mentioned the crash log, the analysis of the problem of heap memory leakage caused by JNI Https://blog.csdn.net/cza55007/article/details/50755011#commentBox


Appendix:

Address: Memory start addresses Kbytes: bytes in memory (KB) RSS: bytes reserved (KB) Dirty: Number of bytes of dirty page (including shared and private) (KB) Mode: Permissions for Memory: Read, write, execute, Shared, private (write-time replication) Mapping: Memory-consuming files, or [anon] (allocated memory), or [stack] (stacks) Offset: File offset Device: Device name (Major:minor)


JVM Fatal error log (Hs_err_pid.log) analysis

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.