First, the preface
Java is an object-oriented high-level programming language that spans the hardware platform, Java programs run on a Java Virtual machine (JVM), which manages memory by the JVM, which is the biggest difference from C + +; Although memory has JVM
operating system maximum of 2G, There are no restrictions on 64-bit operating systems, and their size is controlled by-XMS and-xmx,-xms the minimum heap memory requested for JVM startup, 1/64 of physical memory by default, but less than 1g,-xmx for the maximum heap memory that the
directive code corresponding to a particular processor hardware platform (for example, Intel's Pentium microprocessor or IBM's system/390 processor). Bytecode is platform-independent code that can be sent to any platform and can be run on that platform.The Java heap is the primary area of garbage collector management, so it is also known as the GC heap. Since the garbage collectors are basically using generational collection algorithms, the Java heap
actually the JVM parameters, we first understand the JVM memory management mechanism, and then explain the meaning of each parameter represents.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 arra
requested by the JVM, which defaults to 1/4 of physical memory but less than 1G By default, when the free heap memory is less than 40%, the JVM increases the size specified by heap to-XMX, which can be specified by-xx:minheapfreeration=, and when the free heap memory is gre
Java memory management and memory overflow exceptions, java memory management Overflow
Speaking of memory management, I would like to first compare the differences between java and C ++
the following JVM parameters at runtime-verbose:gc //设置跟踪gc-XX:+PrintGCDetails //打印详细的gc内容-Xms20M //设置堆内存最小内存为20M-Xmx20M //设置堆内存最大内存为20M-Xmn10M //设置新生代内存为10M? The result of the operation is as follows, it can be seen that my native JVM default garbage collector (parallel) used by the generation of collection algorithm, heap memory for the generation of
For developers engaged in C, C + + program development, in the field of memory management, they have the "ownership" of each object, but also bear the responsibility for the beginning of each object's life to the end of the maintenance.
For Java programmers, with the help of the virtual machine automatic memory management
How is the memory area of the JVM divided?In the memory partition of the JVM, some areas are thread-private, some belong to the entire JVM process, some of them throw oom exceptions, others do not, and understanding the memory par
This article from the NetEase cloud community
Luzon Sheng
The biggest feature of the Java language compared to the C language is that programmers don't have to worry too much about Java's memory allocation and recycling, because all of this, Java's virtual machines have helped us. The memory management of the JVM grea
In the previous articles, the system learned the next JVM memory structure, Java memory model, Java object model, but found themselves or the three concepts and differences are more vague, silly points unclear. So there is this article, this article is mainly on these three technical points to make a summary and distinguish, deepen the impression.JVM
, temporary variables, and return addresses of functions. Unused extents are prestaged areas that allocate new memory space.Second, process and JVM memory modelThe JVM is essentially a process, so its memory model also has the general characteristics of the process. However,
types, object reference types, and returnaddress types known to the compiler, and the memory space required to complete allocations during compilation.
Exception: 1) Stackoverflowerror exception, thrown when thread request is greater than the depth allowed by the virtual machine
2) OutOfMemoryError exception, if the virtual machine stack can be dynamically extended, when the extension cannot request enough memory
multithreading, and languages that support multithreading on multithreaded platforms should provide a solution to the problem.
The JVM is a virtual computer, it will also face multi-threaded concurrency problems, Java programs run on the Java Virtual Machine platform, Java programmers can not directly control the underlying thread to register cache memory synchronization between, then Java from the syntact
this allocation, the memory of the object in the heap needs to wait for GC to recycle, heap on 32-bit operating system maximum of 2G, There are no restrictions on 64-bit operating systems, and their size is controlled by-XMS and-xmx,-xms the minimum heap memory requested for JVM startup, 1/64 of physical memory by def
Eclipse.ini Memory settings
-vmargs-xms128m-xmx512m-xx:permsize=64m-xx:maxpermsize=128m
Here are a few questions:
1. What are the meanings of each parameter?
2. Why do some machines I have-xmx and-xx:maxpermsize set to 512M after eclipse can start, and some machines will not start?
3. Why are the above parameters written to the Eclipse.ini file eclipse does not perform the corresponding settings?
Let's answer each of these.
1. What are the mean
GB in windows and 2 GB-3 GB in Linux ), the 64-bit and above processors will not be limited.
Through the introduction of JVM memory management, we have learned that JVM memory includes two types: heap memory and non-heap
),
Method Area,
Chang (Runtime Constant Pool),
Local methods Stack (Native method Stacks),
However, the memory layout and address space for each block area are not clearly defined, leaving the space for each JVM vendor to play.Hotspot Jvmsun's own hotspot JVM implements a relatively clear description of the heap
Deep understanding of JVM memory zone and memory overflow
Document directory
1.2. HotSpot Virtual Machine
1.3. troubleshooting of OOM exceptions
1.4. Reference
Java memory overflow exception
Data Area During Running
Program counters
Row number indicator of the bytecode executed by the current thread
Summary: After Tomcat deploys multiple projects, the startup Tomcat is normal and the error occurs when you access the projectCheck on the internet and tried several times, only to solve, the solution is recorded to facilitate later viewing or to meet the same problem friends have a referencePermGen space is what will not say, looking for a lot of online, feel there is no need to remember these conceptsThe root of the problem is that the JVM does not
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.