Generally in the 3-Tier architecture, the most common problem is Out of Memory (memory
Insufficient), or the situation of Memory Leak, it is often caused by Application Server
Failure and system crash, allowing managers to always wait next to Server, pay attention to it
Unit status and operational situations to avoid it Crash.
This topic report is aimed at this type of problem, from JVM its basic architecture,
And the question and answer is used to explain the explanation, and the instructions are provided, and the instructions are provided.
Project self-tests to avoid Memory Leak effectively mastering resource.
What is OUT OF MEMORY? Memory Leak?
Out of memory definition
The memory is not sufficient to provide components regardless of Java HEAP or Native Memory.
Memory Leak Definition
Components' memory use continuous growth in Java HEAP or Native Memory,
Finally, the case where Out of Memory occurs.
What is Java HEAP, Native Memory and Process Size
To understand the occurrence of Memory Leak issues, first understand how many JVM's memory management is important.
The name:
Java HEAP
This is the Memory of JVM to configure Java Objects, and the Java HEAP memory size is
Commands to perform the parameters below the column - xmx settings. If the largest Heap size is not defined, then it
The size limit will be regarded by JVM, such as the physical memory of the machine and the remaining memory
set. Therefore, it is generally recommended to set the value of the largest Java HEAP.
Native memory
This is the memory used by JVM to work within it, Native Memory HEAP will be JVM
Use, and its size depends on the resulting code, the resulting Thread, GC is used to save Java
Temporary space when Object Information and Generation or Best Code Code
If it is the Native Module of Third Party, it will might use Native Memory.
Such as: Native JDBC Driver is to configure Native Memory.
The maximum value of Native Memory is limited to any OS Virtual Process Size and
The memory size of the Java HEAP is specified by the parameter-xmx. For example: if the application system can
Configure 3GB, and if the maximum Java HEAP size is 1G, then Native Memory is the largest.
Values may be close to 2GB.
Process Size
Process size will be Java HEAP, Native Memory and is used to load execution and letters
The memory of the memory of the library, the 32-bit job system, one handler virtual address space
To 4GB; if more than 4GB, the core of the work system will reserve a part to use itself (generally
1 ~ 2GB). Then the rest is to the application system.
Windows: It is assumed to have 4GB memory, preset to the application system to use the maximum 2GB and
The 2GB is used for the core. In this way, in some different versions of Windows, you can use / 3GB
The parameter switches this scale value, allowing the application system to get 3GB memory. For details, please refer to Microsoft
Website address site:
Http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ddtools/hh/ddt
OOLS / bootini_1fcj.asp
Red
Hat
AS
2.1: Application system can use the maximum memory size of 3GB
For other job systems, please refer to the job system file to make settings.
PROCESS address space and entity memory
Every Process has its own address space, at the 32-bit duty operation system, this address is empty
It is between 0 and 4GB. This is the independent RAM or SWAP Space on the machine, all of the machine
The entity memory is the addition of RAM and SWAP Space on the same machine, all execution
Process Share this entity memory.
The memory address of Process is virtual. Work system core corresponds to this virtual address to real position
site. The physical address refers to a certain position in the entity memory. All specific times on a machine
The virtual memory of the process being being executed, and its plus is not exceeded in the same machine.
Body memory size.
Why happened to the Out of Memory? In this situation
What is the disposing of JVM?
Out of memory in java heap
If the JVM cannot obtain memory in Java HEAP to configure more Java Objects, JVM will
Throwing a Java Out of Memory error, JVM cannot configure more Java Objects if heap is
The Objects that is being used and the Java HEAP cannot be expanded.
Under this condition, after the java.lang.outofMemoryError error message, JVM will
Let the application system decide what to do. For example: The application system monitors this error and decides in that one.
Stop execution in the mode, or no matter what this error. If the application system does not process this error, then
Thread will throw this error message and stop performing leaving JVM (if used in Java Thread
Dump, you will not see this thread).
WebLogic Server is in this situation, if it is throwing out of an Execute Thread, this
Errors will be monitored and recorded. If this is continuously throwing, then Core Health
Monitor Thread will stop WebLogic Server operation.
Out of memory in native heap
If the Native Memory cannot be configured to the memory space, the JVM throws the Native Out of Out.
Memory, which usually happens in Process to reach the processing size limit or machine
The row exceeds RAM and SWAP Space plus. When this occurs, the JVM processes Native Out Memory cases, and records the message indicating that it performs Out of Native Memory or the memory cannot be acquired and left. If the JVM or any loaded Module (like a Libc or a Third Party) cannot process this Native Out ofMemory situation, then the job system will transmit a Sigabort message to the JVM, which will stop the JVM stop. The JVM will generate a program code archive when it gets the SIGABORT signal.
Handling this problem steps
Java Out of Memory
1. Collect and analyze the error message output of Verbose GC