"Skill Library"--JVM crash how to open core dump how to analyze (280) _JVM

Source: Internet
Author: User
Tags cpu usage jboss

1.core Dump Introduction

Program abnormal exit (crash) will automatically generate a core file, including the program running memory, register state, stack pointers, memory management information, that is, the state of the program at the time of the work stored into a file. Not only will the core dump file be generated when the error occurs, it can also manually trigger the generation of core dump files when the system is jammed or the CPU usage is high (which can, of course, be dump out of memory and thread stacks directly through Jmap and Jstack, But JDK1.6 previously, these 2 commands are often unsuccessful), so that can be well analyzed.

2. Generate Core Dump Files

The core dump file generation switch is actually controlled by the size of the generated file, the default size is 0, which means the default is to not generate the core dump file, can be viewed through the command ulimit-c. Modifying this parameter to unlimited can generate a core dump file, but it is worth noting that each application process reads its own set of system parameters and can view the memory files for the process/proc/<pid>/ The information in the limits to determine whether the modified parameter value is in effect for this application process, and the limits file is as follows:

Limit Soft Limit Hard Limit Units
Max CPU time Unlimited unlimited seconds
Max File size Unlimited Unlimited bytes
Max Data size Unlimited Unlimited bytes
Max stack size 10485760 Unlimited bytes
Max core file Size Unlimited Unlimited bytes
Max resident set Unlimited Unlimited bytes
Max processes 20480 20480 processes
Max open files 204800 204800 files
Max locked Memory 32768 32768 bytes
Max address space Unlimited Unlimited bytes
Max file Locks Unlimited Unlimited locks
Max pending signals 1024 1024 signals
Max msgqueue size 819200 819200 bytes

The corresponding parameter value in the above information is unlimited, and the core dump switch representing the application process is open. Ulimit-c Unlimited This command can be modified in a number of places, such as using root on the command line, and adding in/etc/profile (/etc/profile file already has defaultulimit-s-C 0 >/dev/ Null 2>&1, you can modify 0 directly to unlimited), in the user's. Bash_profile. The scope of the impact of these methods is still quite complicated, and it is not clear yet. At that time through the root user command line modified, in the shell query ulimit-c is effective, that the application is also in effect, do not need to restart the application is not required to enter into force is good, wait until the next time crash found or did not generate a core dump file, so to the file/ Check this parameter value in Proc/<pid>/limits to find that the value read by the application is still 0. Later, a simpler and more straightforward way, with the root user to modify the value of the ulimit-c in the/etc/profile file, and then login again, restart the application, and then check the value in the/proc/<pid>/limits to ensure that the parameters are in effect, Later application of crash when the core dump file also scheduled, the heart is dark, finally can start analysis stack.

The default path generated by the core dump file is in the user's working directory (the Startup script directory), which changes the final build path and file name format of the core dump file by setting the value of the parameter/proc/sys/kernel/core_pattern. After the core dump file was successful, the log in the JBoss console error log also had the core dumped keyword, as follows:

/opt/.../jboss/bin/run.sh:line 181:9,176 segment Error (core dumped) "$JAVA $JAVA _opts-djava.endorsed.dirs=" $JB Oss_endorsed_dirs "-classpath" $JBOSS _classpath "Org.jboss.Main" $@ "


3.core Dump Analysis

Reference: http://blog.csdn.net/cpzhong/article/details/7191811

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.