This article is suitable for users who have some knowledge about Tomcat and JVM.
Common built-in variables:
Catalina_base // used to set the storage location of files that can have write permissions or custom parts. In applicable scenarios, you need to start multiple Tomcat instances on a node to define multiple catalina_base.Catalina_opts // defines the JVM running attributesJava_opts // defines multiple
JVM introduction,[Switch] JVM Introduction
1. What is JVM?
JVM is short for Java Virtual Machine (Java Virtual Machine). JVM is a specification used for computing devices. It is a fictitious computer, it is achieved by simulating various computer functions on the actual comp
Document directory
JVM loading principle
JVM loading principle
The operating system is installed with jvmthrough java.exe in JDK. The following four steps are used to complete the JVM environment.1. Create a JVM loading environment and Configuration2. Load JVM. dll3. init
This article is transferred from https://zhuanlan.zhihu.com/p/25713880. Basic concepts of the JVMThe Chinese name of the JVM is called a Java Virtual machine, which is a virtual computer run by software technology that simulates a computer.The JVM also acts as a translator, and the Java program we write is not directly identifiable by the operating system, and the JVM
()" }, "{[/error]}": { "bean": "requestMappingHandlerMapping", "method": "public org.springframework.http.ResponseEntity
Metrics
One of the most important monitoring contents, mainly monitors JVM content usage, GC conditions, class loading information, and so on.
Start the example project and access http: // localhost: 8088/monitor/metrics to return the following information:
{ "mem": 337132, "mem.free": 18
JVM Performance Analysis and Tuning
1) reasonably configure Parameters
Jvm memory = heap memory + non-heap memory
Heap memory = new generation + Old Generation = 1 Eden zone + 2 vivo VO zones
Non-heap memory = persistent generation + code Cache
-Server: server mode. This parameter is placed at the beginning of the configuration item.
-Xms: the initial heap size. The unit is MB.-Xms is the same as-Xmx, whic
Why 1.JVM can cross-platformThe JVM can execute Java bytecode (the JVM bytecode instruction set) across the computer architecture (operating system), masking the differences between the software or hardware that can be associated with each machine platform , making the platform-related coupling unified by the JVM provi
threads and their current activity status.
Deadlock Detection Chart Deadlock DetectionDisplays a deadlock chart that contains all of the deadlocks in the JVM.
Currently used monitor current monitor useageDisplays the monitors that are currently in use and includes their associated threads.
History Test Records historical usageDisplays a history of si
1. What is a JVM?The JVM is the abbreviation for Java Virtual machine (Java VM), which is a specification for computing devices, a fictional computer that is implemented by simulating various computer functions on a real computer. A Java Virtual machine consists of a set of bytecode instructions, a set of registers, a stack, a garbage-collected heap, and a storage method domain. The
Write a Java program in myeclipse and try to call the encapsulated DLL. the following error occurs in the console:
# An Unexpected error has been detected by hotspot virtual machine:## Prediction_access_violation (0xc0000005) at PC = 0x10005301, pid = 708, tid = 3224## Java VM: Java hotspot (TM) Client VM (1.5.0 _ 13-b05 mixed mode, sharing)# Problematic frame:# C [kdccavayacomm. dll + 0x5301]## An error report file with more information is saved as hs_err_pid708.log## If you wowould like to sub
Execute the following jni call:
Copy codeThe Code is as follows: package jni;
Public class JNITransObject {
Public native TestJNI [] ObjectMethod (String text );
Static {System. loadLibrary ("JNITransObject ");}
Public static void main (String args []) {JNITransObject jniTransObject = new JNITransObject ();
TestJNI [] testJNIs = jniTransObject. ObjectMethod ("jni trans object ");
For (int I = 0; I System. out. println (testJNIs [I]. getTopic ());}}}
The following error is reported:## A fatal er
escape analysis can be analyzed, this local variable StringBuffer escaped its scope.So, based on the escape analysis, the JVM can determine that if the local variable StringBuffer does not escape its scope, then it can be determined that the stringbuffer is not accessed by multithreading, then you can remove these extra locks to improve performance.2. Lock optimization within a virtual machineThe object header is introduced first, and in the
Tomcat itself cannot run directly on the computer, it needs to rely on a hardware-based operating system and a Java virtual machine. Tomcat's memory overflow is essentially a JVM memory overflow, so at the beginning of this article, the Java JVM's memory-related knowledge should be described in detail.First, Java JVM memory IntroductionThe JVM manages two types o
MySQL two threads simultaneously read and write to two records
Avoid deadlocks
Security status
find a sequence of assigned resources to make all processes complete successfully
Banker algorithm
use a pre-allocation policy to check if the system is in a secure state when the assignment completes
Deadlock detection
VisualVM (or other tools)
Monitor thread status, if a deadlock occurs t
jcmdis a JDK comes with an artifact, it is easy to profiling the Java program. Jcmd can actually replace a lot of commonly used tools, such as Jstak,jmap. Let us now understand what the jcmd,jcmd can do to help us locate the problem. How we use jcmd in our work.
From Jdk7 onwards, Jcmd is a tool that comes with the JDK. In the case where the JDK's path is properly configured, we can execute it directly at the command line jcmd :
[root@vincent-testing ~]# jcmd -h
Usage: jcmd
With Jcmd, we can
One, the JVM memory model summarizesThere is also a register where the thread runs on top of it1. Program counterRecord the execution location of the thread, the thread private memory, the only area in the Java Virtual Machine specification that does not stipulate any outofmemoryerror conditions2. Thread stacks (VM stack)The default size of the stack is 1M-xss2m This setting to 2MException: Fatal:stack size too smallExceptions are usually caused by to
For a system to locate the problem, knowledge, experience is the key foundation, the data is the basis, the tool is the use of knowledge processing data meansThe use of appropriate virtual machine monitoring and analysis tools can speed up our analysis of data, positioning the speed of problem-solving, this article mainly introduces several servicesCommand-line tools (JPS, Jstat, Jinfo, Jmap, Jhat, jstack) commonly used on theJPS: Virtual Machine Process Health toolThe JPS (
This chapter describes how to embed a JVM into your local program. A jvm can be considered as a local library. A local program can connect to this library and load the JVM through the invocation interface. In fact, the standard starter in JDK is a simple link to the jvm c code. The initiator parses the command, loads t
blocking primitive that does not block through the monitor on the object.)Park: Enter waiting state, compare wait do not need to acquire lock to let thread waiting, wake by Unpark)Thread actionThe reason for the thread state to occur.runnable: The owner zone, State runnableIn object.wait (): Call Wait (), wait set area, state waiting or timed_waiting, decorate waiting onWaiting for monitor entry: Equal loc
the opts of the Java process at runtime.JPS: Similar to PS on UNIX, used to show the local Java process, you can view the local running a few Java programs, and display their process number.Jstat: A very strong monitoring VM memory tool. can be used to monitor the size of various heap and non-heap sizes and their memory usage within VM memory.Jmap: Prints out all the ' objects ' in the memory of a Java process (using PID) (for example, which objects
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.