The configuration of my server:# OS specific support. $var _must_ is set to either true or false.Java_opts= "-xms1024m-xmx4096m-xss1024k-xx:permsize=512m-xx:maxpermsize=2048m"Body:Common memory overflows are listed in the following two ways:Java.lang.OutOfMemoryError:PermGen SpaceJava.lang.OutOfMemoryError:Java Heap Space---------------------------------------------------------Here, for example, the Tomcat environment, other Web servers, such as Jboss
adopts the "sandbox" running mode, that is, the Java program code and data are restricted to a certain amount of memory space.
Row. The program is not allowed to access memory other than the memory space. If it is an applet, access to the client machine is not allowed
File System.
Java Runtime Environment
Either language requires a specific runtime environment
programming language interactions. When the native method is called, it enters a completely new world that is no longer restricted by the virtual machine, so it is also easy to have native heap OutOfMemory that the JVM cannot control.Runtime Data Area components:This is what we often call the JVM's memory. It is mainly divided into five parts--1. Heap: Only one heap space exists in a Java virtual instance2
The Java heap is described as follows:Memory consists of Perm and Heap. whichHeap = {old + NEW = {Eden, from, to}}The JVM memory model is divided into two chunks, one is NEW Generation and the other is an old Generation. In new generation, there is a space called Eden, which is mainly used for storing new objects, and two survivor Spaces (From,to), which are used to store objects that survive each garbage c
I. JVM memory setting principle
The default Java Virtual Machine is small in size. When processing big data, Java reports an error: Java. Lang. outofmemoryerror.
-The initial value of XMS Java heap is set to the same value as-XMS and-xmx to avoid Memory reallocation after garbage collection.
-The maximum value of xmx Java heap. The default value is 1/4 of the phy
Transferred from:
Http://blog.csdn.net/sully2008/article/details/6457570
My Server Configuration:
# OS specific support. $ VaR _ must _ be set to either true or false. Java_opts = "-xms1024m-xmx4096m-xss1024k-XX: permsize = 512 M-XX: maxpermsize = 2048 M"
Body:
There are two common memory overflow types:
Java. Lang. outofmemoryerror: permgen Space
Java. Lang. outofmemoryerror: Java heap Space
---------------------------------
This article has been published by the author Yao piaohai to authorize the Netease cloud community.
Welcome to the Netease cloud community to learn more about the operation experience of Netease technology products.
Overview
In daily program development, many Java programmers are not very concerned about memory usage. Of course, if the programmer is lucky or the system is not tested on a large scale or used by the user, this problem may never occur,
This article has been published by the author Yao piaohai to authorize the Netease cloud community.
Welcome to the Netease cloud community to learn more about the operation experience of Netease technology products.
Overview
In daily program development, many Java programmers are not very concerned about memory usage. Of course, if the programmer is lucky or the system is not tested on a large scale or used by the user, this problem may never occur,
JVM in-depth notes (2) Simulation of memory overflow scenarios
Author: Liu Da-poechant
Email: zhongchao. USTC # gmail.com (#-> @)
Blog: blog.csdn.net/poechant
Date: Feb. 23St 2012
Deep JVM notes (1) How are memory areas divided? This article describes the division and Managem
1. Heap and non-heap (non-heap) memoryAccording to the official statement, "Java virtual machines have a heap, the heap is a runtime data region, and all class instances and arrays of memory are allocated from here." The heap is created when the Java virtual machine is started. "" The memory outside the heap in the JVM is called non-heap (non-heap
New Object ();Main reference: "In-depth understanding of Java Virtual Machine", without the consent of the author and the original book to prohibit reprint.Data regions in the JVMThe data in the JVM is divided into the following areas:which1. Program Counter:A program counter is a small amount of memory space that is the line number indicator of the bytecode that is executed by the current thread . In other
These days because of the development of a Web site in the 768M memory of the machine can not afford to run more than 100 users, because each user enabled features, the system will assign each user 8 or so independent threads, my article http://www.mzone.cc/article/311.html also introduced. The problem that often arises on small-memory machines is the Cann ' t allocate
http://longdick.iteye.com/blog/473866Diagram of the JVM memory modelBlog Category:
Jvm
JVM Activity Sun/*** Reprint Please indicate author Longdick http://longdick.iteye.com**/The Java memory model consists of 3 generations, and the default permutations of each
Today encountered a problem, when I add the configuration file (*.xml) content, restart TOMCAT6 when the console error: Java.lang.StackOverflowError;That is, the stack overflow error.Memory overflow, that is, the program runs to use more memory than the virtual function provided by the maximum memory memory overflow occurs. A
1. Memory Analysis1.1 jmap-histo commandPID = 'jps | awk' {if ($2 = "JPs") Print $1 }''Jmap-histo $ pid> 1.txtNum # instances (number of instances) # bytes (byte) Class NameExplanation of Class NameB Represents byteC Represents charD stands for doubleF stands for floatI Represents intJ stands for longZ represents BooleanThe front side has [representing arrays, and [I is equivalent to int []The object is represented by a [L + class nameIf the number of
1. Java Garbage Management mechanism
Object dead Judgment Method:
1 Reference counting method, 2 accessibility analysis algorithm (roots by GC to whether the class is reachable)
Reference:
Strong references: Common in code, generating objects with new, so strong references never recycle referenced objects
Soft reference: Before the system memory overflow, this kind of object will be a second recovery, if t
translator into an intermediate code called bytecode, which is then translated by the Java platform interpreter into machine language to execute, the core of which is the JVM.The compilation process for Java differs from other languages. Languages such as C + + are inextricably linked to the computer's hardware platform information at compile time. The compiler will convert the operands and opcode of all instructions into the offset of memory, that i
We usually use a 32-bit JVM (64-bit JVM will lose 10-20% performance, usually not recommended), and the 32-bit program should be 4GB to address space, why the JVM memory on Linux only use 2GB?
After communicating with the JDK development team, we finally got some relevant reasons. This problem exists in some earlier
because of the development of technology is not absolute. It is also the most important area of garbage collector management. Can be divided into: The new generation and the old age and other divisions, so that the purpose is to facilitate the division and recovery of memory. The JVM specification describes an area that can be physically discontinuous but logica
Memory Management Technology (II), memory pool, and memory management
Well, this article describes the available multi-thread memory pool.
Zero or previous eggs: Do not reload Global new
Maybe it's a very unpleasant experience, s
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.