OutOfMemoryError in the development process is commonplace, encountered this error, novice programmers know from two aspects to solve: one is to troubleshoot whether the program has a bug causing a memory leak, and the second is to adjust the JVM startup parameters to increase memory. OutOfMemoryError There are several cases, each time you encounter this error, o
Jinfo: You can output and modify 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 with
First, what is the JVMJava as the mainstream programming language:
It is free from the constraints of the hardware, one to write, run everywhere;
It provides a relatively secure memory management and access mechanism, which avoids most memory leaks and pointer out-of-bounds problems;
It enables the detection of hot spot code and optimization of Run-time compilation, which enables Java appli
Eclipse. ini memory settings-Vmargs-xms128m-xmx512m-XX: permsize = 64 m-XX: maxpermsize = 128 m
1. What are the meanings of each parameter?
In the parameters-vmargs indicates setting JVM parameters, so the following are actually JVM parameters. First, let's take a look at the JVM m
The reason is that during the test of the new version of our cluster application (three machines), the general JVM memory usage is about 1 GB, but after a period of running, it slowly increases to 4 GB, this is obviously abnormal.
Positioning process:
1. first, follow the steps on the machine to try to reproduce the scene. When a problem occurs, open JDK's jvisualvm on a machine to observe the
Jinfo: You can output and modify 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 with
Jinfo: You can output and modify 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 with
JVM memory region division
Anyone who has learned the C language knows that the C compiler often divides the management area into data segments and code segments when dividing the memory area. The data segments include the heap, stack, and static data areas. In Java, how is the memory divided?
Since Java programs are e
http://backend.blog.163.com/blog/static/20229412620128233285220/Memory management and garbage collection are two of the core components of the JVM, and mastering its internal implementation is a prerequisite for Java developers to develop high-quality Java systems. Recently compiled some knowledge about JVM memory mana
Deep understanding of the memory management mechanism of JVM Notes Runtime data Region program counter JVM stack local method stack Java heap method area run frequent pool Direct Memory object access OutOfMemoryError exception Java heap overflow sample JVM stack and local me
Label: JVM Memory Model1. Specific JVM Program Execution Process
Since Java programs are executed by JVM, when we talk about Java memory partition, it actually refers to JVM memory part
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
The Java heap is described as follows:
Heap = {old + new = {Eden, from, }} Memory is composed of perm and heap.
Heap = {old + new = {Eden, from, }}JVM
The memory model has two major blocks:
New generation,
The other is
Old Generation.
In
New Generation
Is called
Eden
Space, mainly used to store new objects, there are two more
Specified vor spaces (from,
C-language friends know that the C compiler often divides the area of memory into data segments and code snippets, and data segments include heaps, stacks, and static data areas. So in the Java language, how is memory divided?Since Java programs are executed by the JVM, we are talking about the partitioning of the Java memory
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
). Wanyuanhu not live several times extortion there is no money, GC see no value, directly kill off.3, into the genured Gen(pension area) people can basically ensure the safety of the person, but the billionaire will also splurge into the poor, as long as the money is gone, GC or kill off.The purpose of the partition: the new district because the object produces more and most of it is toward the birth, so the direct use of marker-cleanup algorithm. And the old-life is very strong, the use of rep
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
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,
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.