(First: VMWARE-LINUX(CENTOS/6.5/6.6))
一.Jdk:
1.Delete old jdk:
2.add tomcat.tar.jar.gz:
3.tar and mv:
4.configure environment variables:
(the bottom line)
export JAVA_HOME=/usr/java
export JRE_HOME=/usr/java/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin
5. source /etc/profile & java -version:
二.Tomcat:
1.transfer tar.gz(like jdk, but in /usr/local)
2.tar
3.mv apache-tomcat-7.0.22 tomcat & vim /etc/profile:
4.
5.
6.
7.cannot login Server Status:
vi /usr/local/tomcat/conf/tomcat-users.xml
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/>
shutdown.sh
startup.sh
三.JVM:
1.Memory Model:
In the process of executing Java programs, the Java virtual machine divides its managed memory into several different data areas. These regions have their own USES, as well as the time of creation and destruction, some areas exist along with the advancement
of the virtual machine startup, and some areas
establishment are dependent on user thread start and end so we call these areas Java runtime data areas.
2.Heap:
For most applications, Java Heap is the largest area of memory managed by the Java virtual machine, which is created with the launch of the virtual machine. In practice, the
objects and arrays we create are stored in the heap. If you hear about thread-safety, it's clear that the Java Heap is a Shared area, and the members of the operating Shared area have locks and synchronization.
Also associated with Java Heap is the Java garbage collection mechanism (GC), which is the main area of garbage collector management. The new generation, old generation, and permanent generations familiar to the ape are in
the heap, and most of the GC is now basically using the generational collection algorithm. More detailed, like Java Heap and Eden space, From Survivor space, To Survivor space, etc.
*Java Heap can be physically discontinuous in memory space, as long as it is logically continuous.
3.Stack:
Java Stack is thread-private relative to Java Heap, and its life cycle is the same as the thread. Described in the Java Stack is a Java method performs memory model, each method is executed to create a Stack frame is used
to store the local variables and the operand Stack method, dynamic links, export and other information.
As you can see from the figure below, each thread in the execution of a method means that there is a
stack frame in the stack frame that corresponds to the current thread in the stack and out of the stack.
4.Native Stack:
Local method (Native Stack) and the Java virtual machine Stack (Java Stack) is very similar,
the difference between them lies in the virtual machine work for virtual machine Stack perform Java method (i.e. bytecode) service, while the local method Stack work for the use of services to the Native method.
5.Method Area:
Method Area and Heap (Java Heap), are
Shared memory region, it is used to store the virtual machine to load the
class information, constants, static variables, just-in-time compilers compiled code and other data. While the Java virtual machine specification describes the method area as a logical part of the Heap, its has an alias called non-heap. Analyzing the
Java virtual machine specification and the method area is described as a logical part of the heap, it should be considered that they are all in the perspective of storing data.
one storage object data (heap), and the other storage static information (method area).
In the above article, we have seen a new generation, old generation, and permanent generation of the heap. So why we use these three concepts. that's because the HotSpot virtual machine design team
choose the GC generational collection method extended to area, or use a permanent generation method to implement the area. This way the HotSpot garbage collector can manage this portion of memory as well as the Java heap.
More simply, the memory model in the HotSpot virtual machine is divided into generations, among which the new generation and the old generation are stored in the heap, and the permanent generation USES the method area implementation.
According to the official release of map information, now also have to give up the permanent generation and gradually adopt Native Memory to implement the method of planning, in the HotSpot of
JDK1.7, they have shift out the String constant pool from the permanent generation.